Home > DeveloperSection > Forums > Open File Dialog box on <a> tag
Alex Leblois
Alex Leblois

Total Post:67

Points:471
Posted on    September-25-2013 10:08 AM

 HTML5 HTML5 
Ratings:


 1 Reply(s)
 1794  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



Ankit Singh

Total Post:341

Points:2389
Posted on    September-25-2013 10:11 AM

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>

Don't want to miss updates? Please click the below button!

Follow MindStick