Last active
August 29, 2015 14:22
-
-
Save dieseltravis/6c1213bc71141d15380b to your computer and use it in GitHub Desktop.
IE11 has bad XHR that sends 0 bytes to upload a file when there is authentication, it stalls and never returns the 408 error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// more info http://stackoverflow.com/questions/22542772/xmlhttprequest-upload-hangs-after-pause-between-uses | |
// and possibly related: https://support.microsoft.com/en-us/kb/2962872/en-us?wa=wsignin1.0 | |
try { | |
// the someController.uploader is an Angular FileUploader: https://github.com/nervgh/angular-file-upload | |
// its url is set elsewhere to something like "/doc/upload/" | |
jQuery.ajax(someController.uploader.url, { | |
cache: false, | |
crossDomain: true, | |
method: "GET" | |
}).always(function callTheUploader () { | |
// this function is the one that actually uploads the file | |
someController.uploader.uploadAll(); | |
}); | |
} catch (ex) { | |
if (window.console) { | |
window.console.log(ex); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment