在“BeforUpload"中进行处理,当判断当前文件不允许上传时,调用如下代码:
//begin
var progress = new FileProgress(file, 'fsUploadProgress');
progress.setError();
progress.setStatus(data.message);
var toremove = '';
var id=file.id;
for(var i in uploader.files){
if(uploader.files[i].id === id){
toremove = i;
}
}
uploader.files.splice(toremove, 1);
uploader.refresh();
//end
但出现提示信息之后,仍然会继续上传,无法中断当前文件的上传。
也试过如下代码,情况同样。
up.trigger('CancelUpload');
delay(function() {
uploadNext.call(up);
}, 1);
你目前希望是中断上传、还是限制部分文件的上传,如果是终端上传,可以触发plupload组件中的stop()事件,具体可以参考http://www.plupload.com/docs/Uploader#stop--method,如果是限制部分文件类型的上传,可以再上传的option中加上filters参数,具体可以参考 http://www.plupload.com/docs/Options#filters