open *.pdf in another drive

  • Thread starter Thread starter Agnes
  • Start date Start date
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
 
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
 
Back
Top