« Return to Blog

.htaccess Force Files to Download (Not Open in Browser)

Author: Zeeshan Arshad     1510     09/25/2015

Estimated reading time: 0 minutes, 12 seconds

You can force files to download by adding following code into .htaccess file. Add more extensions if needed.

AddType application/octet-stream .csv
AddType application/octet-stream .xls
AddType application/octet-stream .doc
AddType application/octet-stream .avi
AddType application/octet-stream .mpg
AddType application/octet-stream .mov
AddType application/octet-stream .pdf