Forum Moderators: phranque

Message Too Old, No Replies

Force download of mp3 files

Works with some, but not all mp3 files?!

         

kode

1:48 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



Please help!

I've been trying to find a way of force downloading mp3's for an internet radio website and stumbled accross the .htaccess method using:

<Files *.mp3>
ForceType application/octet-stream
Header set Content-Disposition attachment
</Files>

or simply

AddType application/octet-stream mp3

Both seem to work fine for most mp3's but for some strange reason not all of them. I had tried renaming the files that dont work with names that do, to no avail and it is not size dependand as some of the files that don't work are smaller than ones that do. As far as I can tell there is no difference between the files that do and do not work and are all in the same folder.

Any ideas anyone....

jdMorgan

3:01 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What browsers are you testing with?

Jim

kode

3:22 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



Internet Explorer, Mac OS X. I just tried it in Safari too and now even less work!

jdMorgan

3:31 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Flush all the browser caches, and do this every time you test any change to your code.

Also, be aware that IE may ignore the MIME-type of a file if it can determine the filetype by examining the first few bytes. It's another non-standard 'feature' of IE. Try testing with a Mozilla-type browser (Camino/1.0?) as a baseline.

Jim

kode

3:54 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



I'll give it a go. If IE is doing this do you know any other way of doing the same thing? I've heard of people using Javascropt but this seemed to be the easiest way (if it worked that is!) :)