open *.pdf in another drive

A

Agnes

my asp program saved in D:\myASP\Project1.
my document are saved in C:\Web-Doc\*.pdf

<a href="<%#DataBinder.Eval(Container.DataItem,
rtrim("number")).tostring.trim%>.pdf"><%#
DataBinder.Eval(Container.DataItem, "number") %></a>
if my pdf are stored in the same directory with the source project, I can
open the pdf .
However, if <a href='c:\web-doc\abc.pdf'> <-- it said it cannot open the
documnet..
Please help
 
H

Hans Kesting

my asp program saved in D:\myASP\Project1.
my document are saved in C:\Web-Doc\*.pdf

<a href="<%#DataBinder.Eval(Container.DataItem,
rtrim("number")).tostring.trim%>.pdf"><%# DataBinder.Eval(Container.DataItem,
"number") %></a>
if my pdf are stored in the same directory with the source project, I can
open the pdf .
However, if <a href='c:\web-doc\abc.pdf'> <-- it said it cannot open the
documnet..
Please help

That is because the system the browser is running on (do NOT test this
just on your development machine!) does not have a C:\web-doc. This
href point to a local drive, NOT the C: drive of the webserver.

You need something like <a href="servepdf.aspx?file=abc.pdf">...
where serverpdf.aspx accesses that directory outside of the webserver.
It can use Response.WriteFile to send the file to the browser.

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top