open *.pdf in another drive

Discussion in 'ASP .Net' started by Agnes, Sep 7, 2006.

  1. Agnes

    Agnes Guest

    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
    Agnes, Sep 7, 2006
    #1
    1. Advertising

  2. Agnes

    Hans Kesting Guest

    > 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
    Hans Kesting, Sep 7, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon
    Replies:
    5
    Views:
    11,133
    Scott M.
    Jan 17, 2010
  2. mh
    Replies:
    4
    Views:
    688
    Wolfgang Strobl
    May 31, 2005
  3. Tom Anderson
    Replies:
    8
    Views:
    386
    Gerrit Holl
    Sep 15, 2005
  4. Mike Joyce
    Replies:
    3
    Views:
    3,124
    Gordon Rainsford
    May 3, 2006
  5. shailesh
    Replies:
    1
    Views:
    768
    Tim Golden
    Mar 28, 2007
Loading...

Share This Page