-1

I want to open browse window when Plupload init. I tried to trigger button manually but it didn't work. is manually trigger possible to open browse window?

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);
            });
        }
    }
});
Muhammad Omer Aslam
  • 22,976
  • 9
  • 42
  • 68

1 Answers1

0

Something like this should work for triggering the upload for plupload

$('.fileuploader').plupload('start');

but if you are talking about the file browse dialog, that cant be triggered manually as it is OS dependent, but there is a HTML5solution here

Muhammad Omer Aslam
  • 22,976
  • 9
  • 42
  • 68
  • I tried that solution but didn't work. The answer posted at 2012. it look like old. – Maurice Lacroix Nov 26 '17 at 12:05
  • because you are trying to manually trigger that's why it is not possible, only Firefox allows simulating `click` on `` In `Flash/Silverlight/Html4` there is no any possibility to open file dialog programmatically. – Muhammad Omer Aslam Nov 26 '17 at 12:24