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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find file on client PC 1

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
Guys,

I have an ASP page (as you do) and I want to have a button which when clicked opens up a windows explorer type window which will allow the user to locate a file. Once they have selected the file, the filename will be stored in a field on the page.

How do I do this? I don't want to upload the file. I only want to get the filename but I want to rule out typing errors by making the user find the file.

Can anyone point me in the right direction? Mise Le Meas,

Mighty :)
 
use form input type=file:

<input type=&quot;file&quot; name=&quot;FileName&quot; size=&quot;18&quot; maxlength=&quot;50&quot;>

then after form submission, you can get filename from request.form(&quot;FileName&quot;) and if you only want filename.ext, then split on the \ and take the last array item:

arrFile = Split(Request.Form(&quot;FileName&quot;))
sFileName = arrFile(UBound(arrFile))

does that do it for you?
 
lobstah,

That's what I want but I was wondering - can you specify the directory where it starts browsing. Ideally, I would like the browse button to open a particular directory. Mise Le Meas,

Mighty :)
 
i don't think so. it's html, so i don't imagine you have that much control over it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top