-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);
            });
        }
    }
});

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

I tried that solution but didn't work. The answer posted at 2012. it look like old.
because you are trying to manually trigger that's why it is not possible, only Firefox allows simulating click on <input type=file /> In Flash/Silverlight/Html4 there is no any possibility to open file dialog programmatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.