Force filetype download


/ Published in: Apache
Save to your folder(s)

When offering some files such as mp3s, eps or xls, for download on your site, you may force download instead of letting the browser decide what to do.
This snippet will force the download of .xls and .eps files from your server.


Copy this code and paste it in your HTML
  1. <Files *.xls>
  2. ForceType application/octet-stream
  3. Header set Content-Disposition attachment
  4. </Files>
  5. <Files *.eps>
  6. ForceType application/octet-stream
  7. Header set Content-Disposition attachment
  8. </Files>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.