blueimp jquery file upload - “done”, “complete” callbacks not working for IE 9

不羁的心 提交于 2019-11-29 05:55:39

The done event gets fired if the content-type of the response is set to "text/html" or "text/plain" (instead of application/json) when json is being returned from the server. This applies only for browsers that do not support XHR file upload (such as IE9) and where the blueimp plugin is using IFrame transport instead.

Related info under "Content Negotiation" in the plugin documentation: https://github.com/blueimp/jQuery-File-Upload/wiki/Setup

For the record, I ran into this problem when uploading direct to S3, now that their CORS feature allows for that.

The solution was to set success_action_status to '200', and then the Done event was triggered correctly.

In case anyone is still having this issue with direct upload to S3 the solution is to add a success_action_status field with the value of "201". Make sure that that you include it as part of the policy data as well since they have to match.

Apparently when receiving the upload from IE9 S3 will return an empty string. To get it to return XML, which the file uploader needs, you have to tell it return a status of 201.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!