plupload上传完成后如何继续上传 [英] Plupload how to continue to upload after UploadComplete
问题描述
我正在使用plupload 1.5.7(jQuery Queue Widget),上传完成后,添加文件和开始上传按钮消失,由标签代替上传1/1个文件.
I'm using plupload 1.5.7, jQuery Queue Widget, after the upload complete the Add files and Start Upload buttons disappear, replaced by a label Upload 1/1 files.
现在我无法添加其他文件,我需要刷新页面并上传其他文件. 我也尝试了 uploader.splice()和 uploader.refresh()方法,但均未成功.
Now I can't add others files, I need to refresh the page and upload other files. I've tried also the uploader.splice() and uploader.refresh() methods without success.
上传-一个或多个文件 之后,是否可以继续上传?
Is it possible after an upload - of one or more files - to continue to upload?
我的实际配置是:
$("#uploader").pluploadQueue({
// General settings
runtimes: 'html5,gears,flash,silverlight,browserplus',
url: '/upload.php',
max_file_size: '10mb',
chunk_size: '1mb',
unique_names: true,
// Specify what files to browse for
filters: [
{title : "Image files", extensions : "jpg,png"}
],
// Flash settings
flash_swf_url: '/assets/js/plupload/plupload.flash.swf',
// Silverlight settings
silverlight_xap_url: '/assets/js/plupload/plupload.silverlight.xap',
init: {
FilesAdded: function(up, files) {},
UploadComplete: function(up, files) {
up.splice();
up.refresh();
}
}
});
推荐答案
我通常以这种方式进行操作(对不起,目前无法对其进行测试),将初始化代码嵌入到一个函数中,该函数可以随时调用
I use to proceed somewhat like this (sorry, can't test it right now), embedding my initialization code in a function which I can call whenever I want.
va initUploader = function () {
$("#uploader").pluploadQueue({
// General settings
runtimes: 'html5,gears,flash,silverlight,browserplus',
url: '/upload.php',
max_file_size: '10mb',
chunk_size: '1mb',
unique_names: true,
// Specify what files to browse for
filters: [{
title: "Image files",
extensions: "jpg,png"
}],
// Flash settings
flash_swf_url: '/assets/js/plupload/plupload.flash.swf',
// Silverlight settings
silverlight_xap_url: '/assets/js/plupload/plupload.silverlight.xap',
init: {
FilesAdded: function (up, files) {},
UploadComplete: function (up, files) {
// destroy the uploader and init a new one
up.destroy();
initUploader();
}
}
});
};
$(document).ready(function(){initUploader();});
这篇关于plupload上传完成后如何继续上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!