手动触发Plupload的浏览按钮

时间:2017-11-26 11:55:14

标签: javascript jquery plupload

我想在Plupload init时打开浏览窗口。我试图手动触发按钮,但它没有工作。手动触发是否可以打开浏览窗口?

var uploader = $(".fileuploader").pluploadQueue({
    runtimes: 'html5, html4',
    url: '../admincp/controllers/crud.php?type=assetupload',
    max_file_size: '100mb',
    chunk_size: '30mb',
    unique_names: true,
    rename: true,
    multiple_queues: true,
    mime_types: [{
        title: "Dosyalar",
        extensions: "jpg,jpeg,gif,png,pdf,tif,txt,xls,doc,svg,xlsx,docx,ppt,pptx,zip,rar,7z,psd,ai,eps,ps,rtf,odt,ots"
    }],
    filters: [{
        title: "Image files",
        extensions: "jpg,jpeg,gif,png,pdf,tif,txt,xls,doc,svg,xlsx,docx,ppt,pptx,zip,rar,7z,psd,ai,eps,ps,rtf,odt,ots"
    }],
    init: {
        BeforeUpload: function (up, file) {
            up.settings.multipart_params = {
                filename: file.name
            };
        },
        FilesAdded: function (up, files) {
            up.start();
        },
        UploadComplete: function (up, files) {
            up.splice();
            up.refresh();
            $.get("../admincp/controllers/crud.php?type=getassets", function (data) {
                $("#assetlist").html(data);
            });
        }
    }
});

1 个答案:

答案 0 :(得分:0)

此类内容适用于触发plupload

的上传
$('.fileuploader').plupload('start');

但如果您正在谈论文件浏览对话框,则无法手动触发,因为它OS依赖,但此处有HTML5solution