blueimp/jQuery-File-Upload — Issue #922: programatically trigger file selector dialog
Author: patrickleet
Created: 2012-01-04 22:13:18+00:00
State: open

I would like to trigger the file upload dialog when a user clicks a button that is outside of the form. The upload form is hidden in my example, so clicking this button shows the "Upload Area" and should trigger the file selector pop-up.

I've tried

$("button.myButton").on("click", function()
{
var $parent = $("#uploadContent");
if ($parent.hasClass("upload-panel-hidden"))
{
$parent.switchClass("upload-panel-hidden", "cnv-upload-panel-shown", 300);
}

// trigger upload selector, maybe .click on something?

});