Forcing MP3 Downloads on Apache

Posted by JuanJose on Apr 6, 2009 in Web Hosting |

I keep seeing this more and more often. Apparently the proper mime-types keep getting set for mp3 files and browsers are properly responding – so rather then downloading (depending on your setup) the file might just end up playing from your browser! The horror! (People, just save the target file!)

Anyhow, if your application is meant to send the file as a download you really should be forcing it rather then relying on your visitor’s settings. Put the following into your .htaccess file to force the download:

AddType application/octet-stream .mp3

You can also add more extensions to that line in order to force the download of more file types such as:

AddType application/octet-stream .mp3 .flv .mov .wav

You get the idea! Any questions? Enjoy!

Tags: , ,

Leave a Reply

XHTML: You can use these tags:' <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2006-2010 Gimme Soda All rights reserved.
Desk Mess Mirrored v1.4.6 theme from BuyNowShop.com.