The Blog of a Programmer
Forcing MP3 Downloads on Apache
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!
| This entry was posted by JuanJose on April 6, 2009 at 6:59 pm, and is filed under Apache, Software. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |