JQuery-File-Upload does not start callback in Internet Explorer (IE9)

I checked some questions on the same issue, upload jimpery blueimp file - "done", "complete" callbacks not working for IE 9 , but even after my Content-Type as "text / html" as the answer " callback "did not start. Just like jQuery-File-Upload says that I need to redirect to upload the downloaded file ( https://github.com/blueimp/jQuery-File-Upload/wiki/Cross-domain-uploads ) after the download is complete, but it is also not done. Any help would be greatly appreciated. Best wishes.

+7
javascript jquery internet-explorer jquery-file-upload
source share
2 answers

The most voted answer is not the best solution and may cause errors. Actually, setting dataType not recommended for IE <10, from this (amazing) article:

If the dataType parameter is set to text, json, html, or script, the iframe transport does some processing for the response. Because it works on a DOM object obtained from the used iframe, however, and not the raw data of the HTTP response, there is potential for some surprises to pop up.

http://missioncriticallabs.com/blog/2012/04/lessons-learned-from-jquery-file-upload/

The real solution:

The "thing" about not shooting in IE <10 is not related to dataType , it's just the lack of an add callback that causes the file to insert the fileupload event.

 $('#file_file').fileupload({ add: function (e, data) { data.submit(); //this will 'force' the submit in IE < 10 }, done: function (e, data) { alert('Done'); } }); 
+7
source share

OK, so I'm going to work. The problem was that in the fileuploader configuration I had

 dataType: 'json' 

but since IE9 uses an iframe, it makes an html request and the response has a Content-Type 'text / html'. With this configuration, the file loader expects to receive a json response, so my answer was triggered by a callback rollback that I made for testing. Got it working by looking at this post jQuery FileUpload doesn't run 'done'

+10
source share

All Articles