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

File on another server

Status
Not open for further replies.

Kindi

Programmer
Jan 31, 2001
54
GB
I have an ASP page that allows a user to download a file. The file is sitting on another server, but is mapped to the server where the script is executing. so in the HTML tag, this is how i create the link:

<a href=&quot;file://h:/downloads/download.pdf&quot;>download file</a>

This does not seem to work, so it thought i would try the file system object available with ASP, but have not had any luck, can anyone help?

Thanks
 
I think you need three /'s after file: so it should be...

<a href=&quot;file:///h:/downloads/download.pdf&quot;>download file</a>

Hope this helps...

G
-GTM Solutions, Home of USITE-
-=
 
Hi

I have tried that, but afraid that this did not work either
 
Have you tried using a virtual path to the file?

../downloads/download.pdf

or whatever the case might be??

Also, you can use server.mappath to get the absolute position of the file, and then use that path to retrieve it.

server.mappath(&quot;../downloads/download.pdf&quot;)

You could response.write the result of the above to fix your current statement, or just use it to find it each time.

good luck! :)
Paul Prewett
penny.gif
penny.gif
 
Can I just clarify your situation. You want to link to a file which is on another server via a mapped network drive. Is that right?

G -GTM Solutions, Home of USITE-
-=
 
Hi,
When you are working locally may be everything is OK.
I'm afraid that you cannot do what you want only with local network mapping.
The nature of URL links do not allow so.
What you could do is to make virtual directory on your web server to connect to your mapped network drive. If it is MS IIS (Internet Information Service) this is possible from Settings/Control Panel/IIS - right click on Web service Add new / Virtual directory.
Still this may could not be your solution because of some network limitations. Then you have to copy you files for download in the directory of web server. Or at least to be on a phisical drive on a machine where the Web server is installed, so to you allow you to make virual directory.
Hope this helps.
D.
 
Hi

I now have the problem sorted. In IIS you can set a directorys path to another PC.

However my next problem is how with ASP can you detect that a file exists?

Thanks for the feedback
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top