I\'m using jQuery
file upload plugin.
I don\'t use the UI
part, only basic one.
When I do the following, I\'m having an issue in
I ran into this same issue. IE 9 would not trigger the done
callback, but would trigger the always
callback. The tricky part was extracting the JSON response object from the arguments. (Despite what the documentation claimed, I did not find that I needed to include jquery.iframe-transport.js.)
My implementation of the always
callback looked something like this:
always: function(e, data) {
var result;
if (data.textStatus == 'parsererror') { // IE9 fails on upload's JSON response
result = JSON.parse(data.jqXHR.responseText);
} else if (data.textStatus == 'success') {
result = data.result;
}
if (result) {
// ...perform custom handling...
}
}
I believe issue can be in server response, you can make sure that server always send correct heading by using following code:
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-type: text/x-json");
echo json_encode($array);
exit(0);