我正在使用plupload 1.5.7,jQuery Queue Widget,上传完成后添加文件和开始上传按钮消失,取而代之的是标签上传1/1文件.
现在我无法添加其他文件,我需要刷新页面并上传其他文件.
我也尝试过uploader.splice()和uploader.refresh()方法但没有成功.
我的实际配置是:
$("#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(); } } });
解决方法
我有点像这样继续(抱歉,现在无法测试),将我的初始化代码嵌入到我可以随时调用的函数中.
va initUploader = function () { $("#uploader").pluploadQueue({ // General settings runtimes: 'html5,// 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,UploadComplete: function (up,files) { // destroy the uploader and init a new one up.destroy(); initUploader(); } } }); }; $(document).ready(function(){initUploader();});