Welcome to WebmasterWorld Guest from 23.23.46.20

Forum Moderators: phranque

MIME Type - forcing download

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

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



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 Sep 14, 2010 (gmt 0)

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



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"
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month