How to force your PDF file to download instead of open in browser

14 replies
Hey guys i am sending leads from email link to download offer in pdf format, it's off my site, i have it in the media section off my WP site, the PDF file opens up in the web browser, i would like for it to auto download instead of opening up. How can i do this? Has anybody had similar problem? Thanks
#browser #download #file #force #open #pdf
  • Profile picture of the author XponentSYS
    Hey, not sure if this is the BEST WAY to do it or not but its the way I do it and it works for me.

    I just put it in a "zip" file and link to that. Use "zip" though and not "rar". Rar files are a pain in the ass and will piss people off - zips won't.
    Signature
    "Hybrid Method" Gets 120,846 TARGETED VISITORS
    To Any Site in ANY NICHE!

    NOW FREE IN THE WAR ROOM! CLICK HERE!
    {{ DiscussionBoard.errors[9019764].message }}
    • Profile picture of the author TheWillisWay
      Originally Posted by XponentSYS View Post

      Hey, not sure if this is the BEST WAY to do it or not but its the way I do it and it works for me.

      I just put it in a "zip" file and link to that. Use "zip" though and not "rar". Rar files are a pain in the ass and will piss people off - zips won't.
      I think this is the solution. Whether it opens in the browser or downloads will be determined by the settings on the downloading computer. So if a computer is set to view in the browser as a default there is nothing you can do about it unless its your own Pc.

      There is no browser function to open zip files. So if you zip the Pdf up it will always download as a zip.
      Signature
      Where There is a Willis....There is a WAY!!!
      {{ DiscussionBoard.errors[9020042].message }}
  • Profile picture of the author melvinsh
    I think you just make sure the pdf viewer is set as default
    Signature
    Syndr.com - Social Media Syndication - stop buying fake shares & likes! Get Real Shares from Onlywire & Sendible users managing their own social profiles! Drip feed - Anonymous Shares - Spun Content - View Reports - FREE Accounts - 45+ Social Networks - Take The Tour

    Wanna run a successful Giveaway? SKYPE: Justin.chasar I can get you 1000s of real subscribers, facebook likes, etc. in days
    {{ DiscussionBoard.errors[9020028].message }}
  • Profile picture of the author Rappostion
    This depends on the browser settings of the recipient. They have the option to either
    open a document or save it automatically.
    {{ DiscussionBoard.errors[9020123].message }}
    • Profile picture of the author dean20653
      Originally Posted by TheWillisWay View Post

      I think this is the solution. Whether it opens in the browser or downloads will be determined by the settings on the downloading computer. So if a computer is set to view in the browser as a default there is nothing you can do about it unless its your own Pc.

      There is no browser function to open zip files. So if you zip the Pdf up it will always download as a zip.
      Originally Posted by Rappostion View Post

      This depends on the browser settings of the recipient. They have the option to either
      open a document or save it automatically.
      I agree, that zip is probably the best option.

      however i wanted to add, that the past few days i have been downloading A TON of pdf files from here and other various websites (all using Chrome) and it's been 50/50 not all of them have opened in my browser, some have, but other have just downloaded without even opening. Im not sure HOW, but i just wanted to say my experience if it helps at all. so maybe some more digging will uncover something, Im not sure.

      Best of luck with it!
      Signature

      After 20 years smoking, ecigs FINALLY help me quit!
      Quit smoking today, and use that money to invest in IM

      {{ DiscussionBoard.errors[9020143].message }}
  • Profile picture of the author hustlinsmoke
    I actually use pretty links and a zip, if the file is blank.com/show.pdf then I zip it and now its blank.com/show.zip then use pretty links to say blank.com/1pdf or something like that.

    I do this cause some don't like seeing the word zip on a download. But it usually works.
    {{ DiscussionBoard.errors[9020157].message }}
  • Profile picture of the author huseyinthebrain
    The zip file solution is great and people are not too annoyed by the zip format, but how about on mobile devices? Lots of people love reading my pdfs on their phones and tablets... zip sounds unattractive on mobile
    Signature

    Fantasy Sports the fun way!
    FantasyCouch.com

    {{ DiscussionBoard.errors[9409924].message }}
    • Profile picture of the author zimzalabim
      Originally Posted by huseyinthebrain View Post

      The zip file solution is great and people are not too annoyed by the zip format, but how about on mobile devices? Lots of people love reading my pdfs on their phones and tablets... zip sounds unattractive on mobile
      There are apps available which allow zipping/unzipping on mobile devices. Not used any of them myself though a quick search shows plenty around for IOS and Android. iZip, WinZip etc.
      {{ DiscussionBoard.errors[9410009].message }}
  • Profile picture of the author imogenhobbs
    Zip's are great because you can minimize file size and also place a password in there for the unrestricted people.

    Well, if you want the pdf, you can host it on an alternative site like secured Yousendit or mediafire with a password. That might do! Otherwise, I do recall some wordpress plugins forcing downloads for any type of file, it's probably some download manager.
    Signature
    PM me if you're a self-improv/women dating ghostwriter.

    Lost your way again? 5 basic steps to never "fail"again (WF post)
    {{ DiscussionBoard.errors[9409931].message }}
  • Profile picture of the author JensSteyaert
    Yeah when you add the file to a zip you can also add other files in the zip, which is great for company branding.

    You can even add a hyperlink to your site, that's great if you add plr rights to your ebook and it gets spread around the internet, great free traffic source.
    {{ DiscussionBoard.errors[9410015].message }}
  • Profile picture of the author WillR
    It is NOT determined by the browser of the person viewing the document, contrary to what others have said above.

    Here is how you do it.

    1. Create a folder on your domain such as 'pdf'

    2. Upload your pdf file into that folder.

    3. Create a new text file on your computer and paste the following text into it:

    <FilesMatch "\.(?i:pdf)$">
    ForceType application/octet-stream
    Header set Content-Disposition attachment
    </FilesMatch>

    4. Upload this file into the 'pdf' folder and rename this file to .htaccess

    Done. Now all pdf files in that folder will be prompted to download rather than view online.

    If you are hosting the pdf file on Amazon S3, just right click on the pdf file and select 'Set HTTP Headers'

    Then click on 'Add' > 'Content-Disposition' > 'attachment; Filename=' > Ok.

    This will now force people to download that document rather than view it online.
    {{ DiscussionBoard.errors[9410035].message }}
    • Profile picture of the author DeadRooster
      Originally Posted by WillR View Post

      It is NOT determined by the browser of the person viewing the document, contrary to what others have said above.

      Here is how you do it.

      1. Create a folder on your domain such as 'pdf'

      2. Upload your pdf file into that folder.

      3. Create a new text file on your computer and paste the following text into it:

      <FilesMatch ".(?i:pdf)$">
      ForceType application/octet-stream
      Header set Content-Disposition attachment
      </FilesMatch>

      4. Upload this file into the 'pdf' folder and rename this file to .htaccess

      Done. Now all pdf files in that folder will be prompted to download rather than view online.

      If you are hosting the pdf file on Amazon S3, just right click on the pdf file and select 'Set HTTP Headers'

      Then click on 'Add' > 'Content-Disposition' > 'attachment; Filename=' > Ok.

      This will now force people to download that document rather than view it online.
      Thanks for that! I've always wanted to know how to do it with S3.
      Signature
      Get my latest book! Available in both paperback and Kindle
      {{ DiscussionBoard.errors[9410310].message }}
  • Profile picture of the author sanusense
    I also having the same issue, so I just added a line underneath the Link - Right Click & Save As !

    I hope it will resolve your problem
    {{ DiscussionBoard.errors[9410312].message }}
  • {{ DiscussionBoard.errors[9410343].message }}

Trending Topics