This project has moved and is read-only. For the latest updates, please go here.
1
Vote

Browse and upload in one click

description

Hi everyone !

As the title said, I am trying to browse and upload a file in one click only. I have been told to use javascript but without conviction...
As you knowm you have to browse your file firstm and thenm upload it by clicking on the asp button. Is there a way to do both of them in one and only click ?

Here are the 2 controls :

<Upload:InputFile id="fileCSV" runat="server" />
<asp:Button ID="btnSubmitCSV" Text="Check my Data" runat="server" />

Thank you to all of you.

comments

houak wrote Jun 13, 2011 at 2:08 PM

Actually, I have my answer, thank you anyway haha ^^

For information :

<Upload:InputFile id="fileCSV" runat="server" onchange="javascript:CallUpload();"/>
<asp:Button ID="btnSubmitCSV" Text="Check my Data" runat="server" />

where

function CallUpload() {
    document.getElementById("btnSubmitCSV").click();
}