I have created a new multiple drag drop file upload control with progress bar. It works great with all browsers, except an issue with IE 10 and above.
When I upload files in IE, most of times jquery async request will not complete. It shows pending. I can see it is pending in IE network debugger window. But in all other browsers it work well. I am clueless what is wrong here. Initally I thought it might be something related to caching. But after adding below parameters on server response. It still goes in pending state
context.Response.AppendHeader("Cache-Control", "no-cache"); // HTTP 1.1
context.Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.1

for (var i = 0; i < files.length; i++) {
var data = new FormData();
data.append(files[i].name, files[i]);
uploadFile(handlerurl, data);
}
function uploadFile(handlerurl, formData) {
var jqXHR = $.ajax({
type: 'POST',
url: handlerurl,
contentType: false,
processData: false,
async: true,
cache: false,
data: formData,
xhr: function () { },
success: function (result, status, xhr) { },
error: function (xhr, status, error) { }
});
}
I am calling this function per file. I am not sure what is wrong with IE.
Edit : After debugging, found out that server breakpoint will hit. but there is no files in context.Request.Files. No files send from jquery/AJAX. You can reproduce this issue by keep upload same file again and again.
formDataobjectmultipart/form-dataand also I don't see a comma after xhr and success definitions and the$.ajax({ --- });is not closed properly