Skip to content

Instantly share code, notes, and snippets.

@dieseltravis
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dieseltravis/6c1213bc71141d15380b to your computer and use it in GitHub Desktop.
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
// 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