How can I create a download link?

Discussion in 'HTML & Website Design' started by billybw, Oct 11, 2007.

  1. #1
    I have created a PDF file which I want my site's visitors to be able to download to their computer.

    To test the idea, I put the PDF file in my site's root directory, and then put a regular html link to it on one of my site's pages. Here is the problem: When I click the link, the PDF file immediately opens in my Adobe reader.

    That's not what I want to happen when the link is clicked. Instead, I want the browser to show a SAVE FILE box that will allow a visitor to download the PDF file to their computer.

    Does anyone know what html code I can use for this purpose. For example, is there a special kind of link code that will do it?

    Thank you
     
    billybw, Oct 11, 2007 IP
  2. tattoos

    tattoos Prominent Member

    Messages:
    1,903
    Likes Received:
    150
    Best Answers:
    0
    Trophy Points:
    335
    #2
    When you open a pdf file in a browser there is a "save a copy" button, so you can save it to your computer.. If that is not what you want then I am not sure if there is a special code to force it to download... You could zip the pdf file and link to that!

    James
     
    tattoos, Oct 11, 2007 IP
  3. le_gber

    le_gber Peon

    Messages:
    28
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    billybw, it's nothing to do with html but rather server configuration

    http://www.stuvel.eu/pdfdownload - This explains it all - happy reading
     
    le_gber, Oct 11, 2007 IP
  4. billybw

    billybw Peon

    Messages:
    1,012
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the replies. I looked at the article at http://www.stuvel.eu/pdfdownload, but don't know enough to be able to understand it.

    I've been doing some other searching and found an article that says that it will work if I label or classify the PDF file as an "application". Does anyone know how to do that?
    Thank you.
     
    billybw, Oct 12, 2007 IP
  5. shunny

    shunny Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Upload the file to your root directory-no need to put the pdf tag on the end if it is already a pdf file...so just give it a name then use the code below.

    <LI><a href="name of file.pdf" target="_blank">name of file</a>

    Play around with this...hope it helps
     
    shunny, Oct 13, 2007 IP
  6. eSubmitLinks

    eSubmitLinks Active Member

    Messages:
    380
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    68
    #6
    Perhaps, you might want to zip the file
     
    eSubmitLinks, Oct 13, 2007 IP
  7. Sanma

    Sanma Active Member

    Messages:
    468
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #7
    Or tell your visitors to do this:

    Right click the link > Save target As...

    And that way they can download it instead of opening it.

    Good luck! ;)
     
    Sanma, Oct 13, 2007 IP