我的aspx页面中有一个Plupload控件的上传事件之前有下面的代码,它有三个上传控制上传图像。我的问题是当“Validate_Img_File_Name.ashx”返回未成功输出并停止特定文件上传整体进度条并且进度百分比未达到100%时。 jquery.ui.plupload.js中的函数“_updateTotalProgress:”我做了整体进度,但我不知道如何克服这个问题,因为我对java的知识是零。我怎样才能获得正确的整体进度?非常感谢您的帮助。
BeforeUpload: function (up, file) {
// Called right before the upload for a given file starts, can be used to cancel it if required
//log('[BeforeUpload]', 'File: ', file);
$.ajax({
url: "../Validate_Img_File_Name.ashx",
type: "POST",
datatype: 'text',
data: { filename: file.name },
cache: false,
}).done(function (data) {
if (data == "SUCCESS") {
up.settings.url = '/bulk_img_uploader.ashx';
file.status = plupload.UPLOADING;
up.trigger("UploadFile", file);
up.settings.url = '';
log('File:', file, '- OK');
} else {
//alert(file.name + " " + "fail");
up.stop();
file.status = plupload.FAILED;
up.trigger('QueueChanged'); //Line A
up.trigger('UploadProgress', file); // Line B
up.start();
log('File:', file, ' - ' + data);
return false;
}
});
},