Apache .htaccess Guide, Tutorials and Articles

Apache .htaccess Guide & Tutorial >>

Ensuring media files are downloaded instead of played

It is possible to ensure that any media files are treated as a download, rather than to be played by the browser.
To enable this, create a .htaccess file following the main instructions and guidance, and include the following text:

AddType application/octet-stream .zip .mp3 .mp4

This tells the Apache Web Server to treat .zip, .mp3, and .mp4 files as downloadable, and should be used instead of specifiying them as audio/video/zip files in your MIME types section.

Next Article: Setting up Associations for Encoded Files
Previous Article: Forcing scripts to display as source code


"I tried this method with pdf. But it doesn't work"

Post Comment

Your Name:
Your Comment: