All Collections
Files Management
.htaccess File
How to Make Files Downloadable Upon a Click on a Link
How to Make Files Downloadable Upon a Click on a Link

Learn how to force file downloads using the .htaccess file

Updated over a week ago

Normally, if you click on a file URL, the file will open in the browser. Instead, you can easily force files to download upon a click.

Access the File Manager, find the .htaccess file, and open it to edit. Add the snippet of code below, specifying all the preferred file extensions that you want to make downloadable upon a click on the link:

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

For example, if you'd like to make only the .pdf files downloadable, the line of code would look like this:

AddType application/octet-stream .pdf

Save the changes, and that's it! If you can't see the changes on your live website, try clearing the cache.

Did this answer your question?