469,313 Members | 2,652 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,313 developers. It's quick & easy.

open *.pdf in another drive

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
Sep 7 '06 #1
1 1379
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
Sep 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Lam | last post: by
4 posts views Thread by JIM.H. | last post: by
6 posts views Thread by Moumen VB.NET 2003/2005 Developer | last post: by
4 posts views Thread by jabslim via DotNetMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.