
Hi all – I need the user to select a file from a Dialog. I then only need the path to that file. I’ve been looking and the only way it seems is to use the <input> but i can’t have the user click the choose file button, it must be “clicked” programmatically
Any help would be useful.
PS. THIS IS MY SECOND DAY OF ASP>NET – i also dont know javascript
Aiden
You can use jQuery to apply an event handler to the
changeevent for theinput type="file", but some browsers will return the file path name to the file, some will display a dummy path (with correct file name), and others will just give the file name with no path.EDIT:
To click the file dialog programatically, you can hide it with css using
display: none, and then do$("#<%=myFileInput.ClientID%>").click();to prompt the dialog.