Welcome to WebmasterWorld Guest from 54.196.244.245

Forum Moderators: phranque

Message Too Old, No Replies

MIME Type - forcing download

     
6:51 pm on Sep 13, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 1, 2001
posts: 4392
votes: 0


Right now, when a person clicks on a link to an mp3 file, the mime type is set to automatically play (or try to play) the file.

I'd like to force the browser to download the file rather than start playing it.

Is there a way to locally override the mime type directions in the HTML code?

THANKS.
2:21 am on Sept 14, 2010 (gmt 0)

Senior Member from KZ 

WebmasterWorld Senior Member lammert is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 10, 2005
posts: 2886
votes: 1


You can try to send the Content-Disposition header with the file. I am not sure it is interpreted correctly by all browsers though. As an example to force a download dialog which tries to safe the mp3 file with the name example.mp3:

Content-Disposition: attachment;filename="example.mp3"