Open File Dialog box on <a> tag

Total Post:67


 3103  View(s)
Rate this:

I want to have an Open File dialog box on a link in my webpage.

I tried

<input name="uploadedfile" type="file">

but, it works as a button. And, doesn't allow to select multiple files.

I want to have something like

<a href="#" onclick="some_function_for_OpenFileDialogBox">Upload Files</a>

Please suggest.

Thank You

  1. Re: Open File Dialog box on <a> tag

    Hi Alex,

    You can only open a "Open File" dialog using a input type=file tag. However the efect you are looking for can be accomplished like this :

    <input type="file" id="upload" name="upload" style="visibility: hidden; width: 1px; height: 1px" multiple />

    <a href="" onclick="document.getElementById('upload').click(); return false">Upload</a>


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.