Force download of pdf file

Discussion in 'ASP General' started by Don Grover, Feb 5, 2004.

  1. Don Grover

    Don Grover Guest

    How do i force a user to download from a hyperlink as adobe pdf file, it
    loads up in a new window and I need them to download it, or at least give
    them the choice to download it.
    Don.
    Don Grover, Feb 5, 2004
    #1
    1. Advertising

  2. Don Grover

    Ray at Guest

    Hi Don,
    http://www.aspfaq.com/show.asp?id=2161
    Ray at work

    "Don Grover" <> wrote in message
    news:%23wRt%...
    > How do i force a user to download from a hyperlink as adobe pdf file, it
    > loads up in a new window and I need them to download it, or at least give
    > them the choice to download it.
    > Don.
    >
    >
    Ray at, Feb 5, 2004
    #2
    1. Advertising

  3. Don Grover

    Don Grover Guest

    Thanks Ray
    With 40 billion pages on the web i am finding hard remembering where they
    all are. :cool:
    Don




    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
    message news:...
    > Hi Don,
    > http://www.aspfaq.com/show.asp?id=2161
    > Ray at work
    >
    > "Don Grover" <> wrote in message
    > news:%23wRt%...
    > > How do i force a user to download from a hyperlink as adobe pdf file, it
    > > loads up in a new window and I need them to download it, or at least

    give
    > > them the choice to download it.
    > > Don.
    > >
    > >

    >
    >
    Don Grover, Feb 6, 2004
    #3
  4. Don Grover

    DevSonner Guest

    <a href="download.asp?FileName=aa.pdf">FileDown</a>


    <!-- download.asp //-->
    <%
    Response.ContentType = "application/unknown"

    Response.AddHeader "Content-Disposition","attachment; filename="&
    Request("FileName")

    Set objStream = Server.CreateObject("ADODB.Stream")

    objStream.Open

    objStream.Type = 1

    objStream.LoadFromFile Server.MapPath("/root/pdf/")&"\"& Request("FileName")

    download = objStream.Read

    Response.BinaryWrite download


    Set objstream = Nothing
    %>
    DevSonner, Feb 6, 2004
    #4
  5. Don Grover

    Ray at Guest

    Those that cannot be found at www.aspfaq.com can be found at www.google.com.
    :]

    Ray at work

    "Don Grover" <> wrote in message
    news:%...
    > Thanks Ray
    > With 40 billion pages on the web i am finding hard remembering where they
    > all are. :cool:
    > Don
    >
    Ray at, Feb 6, 2004
    #5
    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. Kele
    Replies:
    0
    Views:
    2,794
  2. gaubo79

    Force Download PDF Problem

    gaubo79, Dec 20, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    13,430
    giridhar86
    May 19, 2011
  3. NUG-IT
    Replies:
    11
    Views:
    1,996
  4. Ricardo Pog
    Replies:
    1
    Views:
    421
    Austin Ziegler
    Mar 26, 2008
  5. Cylix
    Replies:
    1
    Views:
    99
    Randy Webb
    Aug 21, 2006
Loading...

Share This Page