I have got such problem only in IE < 10. My sources:
$("input:file#upload-photo").fileupload({
enctype: "multipart/form-data",
url: $("input:file#upload-photo").attr("url"),
autoUpload: true,
send: function() {
spinner.spin(target);
},
done: function (e, data) {
spinner.spin(false);
var errors = data.result.Errors;
if (errors != null && errors.length > 0) {
for (var i = 0; i < errors.length; i++) {
var ul = $("<ul>").html("<li>" + errors[i] + "</li>");
$('#upload_photo_errors').html(ul);
}
} else {
$(".profile-photo").attr("src", data.result.Data.AvatarUrl);
}
},
error: function() {
spinner.spin(false);
}
});
The 'send' handler is invoked and the 'error' handler is too.
I caught my request in Fiddler. It has no Content-Type and any data:
POST http://172.20.40.45/site/api/Users/Avatar HTTP/1.1
X-Requested-With: XMLHttpRequest
Accept: */*
Referer: http://172.20.40.45/site/Profile/Edit
Accept-Language: ru
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
Host: 172.20.40.45
Content-Length: 0
DNT: 1
Connection: Keep-Alive
Pragma: no-cache
Cookie: ...
I have tried to check the uploading proccess on the http://blueimp.github.io/jQuery-File-Upload/. It works fine in IE9. Why does it not work in my case?