Используйте этот код и проверьте URL-адрес для показа изображений. В моем случае я использую «/Upload/UploadHandler.ashx».
Этот код вы помещаете в main.js.
$(function() {
'use strict';
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload();
$('#fileupload').fileupload('option', {
maxFileSize: 500000000,
resizeMaxWidth: 1920,
resizeMaxHeight: 1200
});
// Enable iframe cross-domain access via redirect option:
$('#fileupload').fileupload(
'option',
'redirect',
window.location.href.replace(
/\/[^\/]*$/,
'/cors/result.html?%s'
)
);
// Load existing files:
$('#fileupload').addClass('fileupload-processing');
$.ajax({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: "/Upload/UploadHandler.ashx",
dataType: 'json',
context: $('#fileupload')[0]
}).always(function() {
$(this).removeClass('fileupload-processing');
}).done(function (result) {
$(this).fileupload('option', 'done')
.call(this, $.Event('done'), { result: result });
});
});
просто не забудьте отправить ответ с правильным json-форматом https://github.com/blueimp/jQuery-File-Upload/wiki/JSON-Response и все все будет в порядке – GoAntonio