Posted By

zeropx on 01/11/11


Tagged

htaccess downloads


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

fana
MicronXD
laurentzziu


Force Download files in htaccess


 / Published in: Apache
 

URL: http://www.thingy-ma-jig.co.uk/blog/06-08-2007/force-a-pdf-to-download

When needing to force download specific file types this comes in handy.

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

Report this snippet  

You need to login to post a comment.