Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,441
    Thanks
    274
    Thanked 32 Times in 31 Posts

    using FilesMatch

    One of my clients had a bunch of pdf files (100's) and they do not want to zip each one of them in order to build a download page

    At first i suggested they they try to find a multiple file zipper or i could write one in php but then we still have to build the page and all the links

    so this was a better option for now, but i have never seen this before.

    Code:
    <FilesMatch "\.(?i:pdf)$">
      ForceType application/octet-stream
      Header set Content-Disposition attachment
    </FilesMatch>
    I put that in my htaccess and now instead of opening the pdf by default in the browser it gives us the option to save or open. Which is better for us it is the lessor of evils..

    Is this the right way to use that, is the coding correct and safe to use, did we do it right?

    Thanks

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Yes, that's perfectly valid to force a download.

  • Users who have thanked Inigoesdr for this post:

    durangod (08-30-2013)

  • #3
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,441
    Thanks
    274
    Thanked 32 Times in 31 Posts
    Thanks Inigoesdr


  •  

    Posting Permissions

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