简体   繁体   English

jQuery文件上传不使用XHR或IFrame

[英]jQuery File Upload not using XHR or IFrame

I have an upload solution using a setup similar to this one where people can drag a file onto the page and have it upload to S3. 我有一个上传解决方案,使用与此类似的设置,人们可以将文件拖到页面上并将其上传到S3。

However, I'm hitting an issue with XHR/Iframe upload. 但是,我遇到了XHR / Iframe上传的问题。 Essentially, if I leave out forceIframeTransport the file will get uploaded to S3 successfully, but the entire page ends up on S3, as that's where the form has submitted to. 基本上,如果我省略forceIframeTransport ,文件将成功上传到S3,但整个页面最终都在S3上,就像表单提交的那样。

When I include forceIframeTransport set to true , nothing happens. 当我将forceIframeTransport设置为true ,没有任何反应。 There are no exceptions in the console, nothing happening on the server. 控制台中没有例外,服务器上没有任何事情发生。

I have included jquery.iframe-transport , jquery.ui.widget and jquery.fileupload in the page, in that order. jquery.ui.widget jquery.fileupload在页面中包含了jquery.iframe-transportjquery.ui.widgetjquery.fileupload

Without your code posted, it is hard to tell, but perhaps it is similar to this issue iframe transport isn't transferring any data 如果没有发布您的代码,很难说,但可能与此问题类似, iframe传输不会传输任何数据

They were using a "fancy" button instead of a regular one and mocking up the onclick. 他们使用的是“花哨”按钮而不是常规按钮并嘲笑onclick。

Post your code, and you might get better answers, or if it is the same as that link you sent, then let us know it is the exact same as that one. 发布您的代码,您可能会得到更好的答案,或者如果它与您发送的链接相同,那么请告诉我们它与该代码完全相同。 Still, it is always good to see the code. 不过,看到代码总是好的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM