Welcome to %s forums

<No. 1 Community for developers, by developers/>

Login Register

How to Force Files to Download (Not Open in Browser) using .htaccess file?

Chat about web technologies (IIS, Apache, etc...), hosting and server management.
Post Reply
admin
Site Admin
Posts: 45

How to Force Files to Download (Not Open in Browser) using .htaccess file?

Post by admin » Thu Aug 22, 2019 3:09 pm

Add as much as file extension you want to be directly downloaded rather than opening in browser:

Code: Select all

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

Post Reply