我通过通用处理程序将 plupload 与 Asp.Net 一起使用。我有一个完全自定义的界面,所以我只是绑定 javascript。我已将其编码为自动启动,但文件一次上传一个。有没有办法让文件并行上传?我为所有内容分配了唯一的文件名,所以这不是问题。
var uploader = new plupload.Uploader({
runtimes: 'gears,html5,flash,silverlight,browserplus',
browse_button: 'select-from-folder',
container: 'uploader',
drop_element: 'uploader-drop-element',
max_file_size: '2000mb',
chunk_size: '1mb',
unique_names: true,
url: '/myuploader.ashx?globalId=' + globalId,
flash_swf_url: '/scripts/plupload/plupload.flash.swf',
silverlight_xap_url: '/scripts/plupload/plupload.silverlight.xap',
filters: [
{
title: "Application Supported",
extensions: "jpg,gif,png,pdf,mp4,flv,avi,wmv"
}
]
});
uploader.init();
uploader.bind('Init', function (up, params) {
// removed for brevity
});
uploader.bind('FilesAdded', function (up, files) {
for (var i in files) {
// removed for brevity
}
uploader.start(); // auto-start the uploader
});
uploader.bind('UploadProgress', function (up, file) {
// removed for brevity
});
uploader.bind('FileUploaded', function (up, file, resp) {
if (uploader.total.uploaded >= uploader.files.length) {
// removed for brevity
}
});