Apache .htaccess Guide, Tutorials and Articles
Username:
Password:
Register / My Account / Forgotten Password?

Ensuring media files are downloaded instead of played

(Edit this article)
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.
<- Forcing scripts to display as source code Setting up Associations for Encoded Files ->

Visitor Comments and Responses

david Article Rating: 5 out of 10
I tried this method with pdf. But it doesn't work
Space Holder
Average Rating: 5.00 out of 10 (1 Votes)

Submit Comment/Rating

Article Rating:
Name: (optional)
Your Comment/Response: (optional)
Powered by OpenCrypt Article Manager
Table of Contents RSS Feed
1. What is .htaccess?
2. How to use .htaccess
3. Error documents
4. Redirects
5. Password protection
6. Deny visitors by IP address
7. Deny visitors by referrer
8. Hot link prevention techniques
9. Blocking offline browsers and 'bad bots'
10. DirectoryIndex uses
11. Adding MIME types
12. Enable SSI with .htaccess
13. Enable CGI outside of the cgi-bin
14. Disable directory listings
15. Setting server timezone
16. Changing server signature
17. Preventing access to your PHP includes files
18. Prevent access to php.ini
19. Forcing scripts to display as source code
20. Ensuring media files are downloaded instead of played
21. Setting up Associations for Encoded Files
22. Preventing requests with invalid characters
23. Useful Resources
 
Sponsors
Space Holder
Space Holder


Copyright © 1999 - 2008 ionix Limited. All Rights Reserved. Company Information, Affiliates

Powered by OpenCrypt Membership Software