Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File browse without upload 1

Status
Not open for further replies.

furtivevole

Technical User
Jun 21, 2001
84
0
0
GB
My user wants to search the network for a file (in the context of an html form) and then store its path without immediately uploading it. Is there a way just to show a client-side browser? thanks.

 
It might be a little convoluted, but yes there is a way. You create a normal file field in the form (input type=file), and have Javascript copy the selected path to a hidden field and then disable the file field, that way the file does not get uploaded, but you keep the path to it.

For example:

Code:
<input type=file name="myfilepath" OnChange="document.formname.hiddenfieldname.value=this.value; this.disabled=true;"



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks vacunita. This does exactly what was wanted. (Not half as convoluted as some things I've ended up doing!)
 
You are welcome.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top