blueimp/jQuery-File-Upload — Issue #1076: Enable button to Replace a file, with new one
Author: vijendrapatil
Created: 2012-03-06 07:36:45+00:00
State: open

I am using JQuery File Upload JS.

This is a sample code

Add files...

Delete all files
Is Public

===============

function browseFile() {

$("#replaceFileCnt").click();

return true;
}

function replaceFile(replaceFileCnt) {
$("#fileBrowse").val($("#replaceFileCnt").val());
/* How to start file upload ? the $('#fileupload').add(); doesnt work */
$('#fileupload').add();
return true;
}

Now in the above example after clicking on the Replace button, performs "click" of replaceFileCnt control which opens up the Browse dialog, and on selecting the file, the "replaceFile" function will get called. In this function i am setting the value of fileBrowse control to the value of replaceFileCnt. But this doesnt start actual upload of the file.

Can anyone help me on this?

Notice that there is areason, why i used replaceFileCnt. The reason is that, i dont want to open a dialog which allows selecting multiple files, when i click on the Replace button.

Thanks