How downloading PDF instead of viewing?

Discussion in 'HTML & Website Design' started by NemoPlus, Apr 13, 2010.

  1. #1
    Hello,

    On my website there are pdf files to download. Today I point directly to the pdf. This will open the pdf instead of downloading it. Today I need to ask the visitor to right-click in order to download.

    Is there a way to tell the browser that he does not need to open the pdf, but that it needs to be saved? This question is not only applicable for pdf files, but also for txt and mp3.

    Thank you.
     
    Last edited: Apr 13, 2010
    NemoPlus, Apr 13, 2010 IP
  2. jinmin

    jinmin Active Member

    Messages:
    448
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    58
    #2
    just zip your pdf file. User will need to download it instead of open for viewing online.
     
    jinmin, Apr 13, 2010 IP
  3. alfa_375

    alfa_375 Active Member

    Messages:
    445
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #3
    I think yes! zip your pdf or mp3 or txt file and upload on your site with link page so that whenever visitors click on that link it will automatically ask user to save that file. Hope you got it now.
     
    alfa_375, Apr 13, 2010 IP
  4. NemoPlus

    NemoPlus Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank you. Zipping would indeed do the trick, but I think that there must be another way, but I don't know how.

    I give an example: you receive a pdf/txt/... file on your GMail account. Then you can choose View/Download/... When you click on the Download link, the browser will NOT display the file, but it will directly download the file (or ask you to choose a download destination). I can't figure out how this works. These files are not zipped.
     
    NemoPlus, Apr 14, 2010 IP
  5. ashu2982

    ashu2982 Active Member

    Messages:
    80
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #5
    http://www.dotnetspider.com/resources/738-Download-file-instead-opening-browser.aspx
     
    ashu2982, Apr 14, 2010 IP
    NemoPlus likes this.
  6. jinmin

    jinmin Active Member

    Messages:
    448
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    58
    #6
    But I think that only works with .asp
    any .html or .php option...?
     
    jinmin, Apr 14, 2010 IP
  7. ashu2982

    ashu2982 Active Member

    Messages:
    80
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #7
    ashu2982, Apr 15, 2010 IP