Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    3
    Member #
    37519

    Force PDF's to download instead of openig in Browser

    We have a PDF fillable form on a client site that we need to force as a download instead of opening in a browser. What we are finding is folks don't understand and or their browser is blocking the form fields from displaying. Because of this, we want the PDF docs on the site to download so they can open, save and email the completed form/application.

    We tried using the following code:
    <a href="http://link/to/file" download="FileName">Download it!</a>

    It works the first time just fine. If someone goes back to the document it then opens in their browser instead of downloading. Additionally, we noticed the download="FileName" is stripped from the code after the link is clicked once.

    Note sure if we need to add additional code to the .htaccess file or if WordPress (their site is built on) is playing a part in the issue.

    Any advice would be much appreciated.

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Force Files to Download (Not Open in Browser) | CSS-Tricks

    That should hopefully do the trick. Put those rules in your .htaccess file (you only need the PDF rule, but if you ever add other document types, you'll need these rules as well).
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Junior Member
    Join Date
    Oct 2013
    Posts
    3
    Member #
    37519
    Perfect! That worked like a charm. Thank you.

  5. #4
    Junior Member evolve's Avatar
    Join Date
    Dec 2013
    Posts
    3
    Member #
    37925
    The resource was useful... however there are other ways to open PDF's in browsers, google around for some other valuable articles. Bye


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

openig browser

Click on a term to search for related topics.

Tags for this Thread

All times are GMT -6. The time now is 07:02 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com