Menu Close

How to Instruct Browser to Download Media Files Instead of Display Them Using htaccess file

Here is a useful method for delivering multimedia file downloads to your users. Typically, browsers will attempt to play or stream such files when direct links are clicked. With this method, provide a link to a multimedia file and a dialogue box will provide users the choice of saving the file or opening it. Here are a few htaccess rules demonstrating the technique (edit file types according to your specific needs):

AddType application/octet-stream .zip .mp3 .mp4 .avi .mpg .wmv

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

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

See also  Stop to Browsing of Directory By Htaccess File and Cpanel