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

Browse for files from .asp page???

Status
Not open for further replies.

hummer010

Technical User
Sep 29, 2000
12
0
0
CA
Is it possible to launch a "browse for file" dialogue from an .asp file?? If so, how??
 
It depends on where the file(s) is located. If the file is located at the client's end, no you cannot. However, you can use ASP to generate a client side script to do that. In addition, it depends on what you intend to do with the file. For example, you can use the <INPUT type=&quot;file&quot;> to produce the &quot;select file for upload&quot; dialog.

However, in general, the DOM security forbids a script to &quot;touch&quot; the local information of a client.

On the otherhand, if the file(s) is located on the server, you use your ASP to generate a simulated &quot;select file&quot; dialog.

hope this helps.

regards,
- Joseph
~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o
VISIT Replica Watches, Jerseys, Pen, Hats, Handbags and More
~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o
 
I have an .asp page which creates a text file on the users computer full of information from an ODBC linked database. Currently I have a text box where the user types in the full path for the file. I get some complaints that the users would like to be able to browse instead.

The .asp creates a new file, so I would like to have a browse for folder dialogue which updates the chosen folder info into the textbox I have.

Is this possible??
 
Hi hummer010 ... curious, how did you manage to use an ASP (server-side?) script to generate a text file and store in the user's computer at the first place ...

In any event, I don't think there is a built-in dialog for you to select a local file path. If you need this, you will need to build a custom COM object.

regards,
- Joseph
===============
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Visit --> for (Replica) Watches, Pen, Handbags, Hats, Jerseys and more ... at prices that makes your code spin ...
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
 
As it turns out, I'm not creating a text file on the users computer. I never even questioned it until you said I shouldn't be able to.

There are only two of us who use the .asp frequently, and the other user's d: drive is mapped to my d: drive. We put all of the text files on the d: drive so that they are accessible to everyone.

The text files were always showing up where they should, so I never questioned it. After reading your post I checked, and I am NOT creating a text file on the users computer. It just seems like I am because both computers have the same d: drive.

In hind sight, I should have realized that it wasn't placing the file on the users computer simply because it is a server side script. D'oh!!!

cheers
hummer010
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top