jquery – Plupload如何在UploadComplete之后继续上传

前端之家收集整理的这篇文章主要介绍了jquery – Plupload如何在UploadComplete之后继续上传前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用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();});
原文链接:https://www.f2er.com/jquery/181401.html

猜你在找的jQuery相关文章