blueimp/jQuery-File-Upload — Issue #807: How to setRequestHeader in beforeSend function ?
Author: google1949
Created: 2011-11-22 08:02:41+00:00
State: open

I want to setRequestHeader with Ajax request in IE on account of a request is not a ajax request.
my code below. but it doesn't work.

$('#fileupload').fileupload({
add:function (e, data) {
data.url = resourceName + '/doUpload.do';
setTimeout(function(){
var jqXHR = data.submit()
.success(function (result, textStatus, jqXHR) {})
.error(function (jqXHR, textStatus, errorThrown){})
.complete(function (result, textStatus, jqXHR) {});
},1000);
},
beforeSend: function (event, files, index, xhr, handler, callBack) {
event.setRequestHeader("X-Requested-With", "XMLHttpRequest");
}
................
..............
}