Forum Moderators: phranque

Message Too Old, No Replies

Set MP3 Mime so save file dialog appears instead of Quick Time?

         

JAB Creations

6:05 pm on Jan 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What do I put in .htaccess to make requested mp3s from my site come up as a save file dialog instead of as part of a plugin such as Quick Time?

John

jdMorgan

8:52 pm on Jan 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This would involve using AddType or ForceType to set the MIME-type in the response header to something other than the current setting, which is detected by the browser plugins as 'playable'. Generally, if you set the MIME-type to application/xyz where xyz is not a media player, it should work. The problem is that you never know what 'odd' MIME_types your visitor may have defined, so I cannot recommend a specific application.

You might want to search through some of the on-line MIME-type listing sites -- But I suggest doing so with a non-IE browser with all scripting support disabled, as some of them are less than reputable.

Jim

JAB Creations

9:06 pm on Jan 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks JD, I'll test it out and let you know how it works out. :)

John

JAB Creations

10:18 pm on Jan 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



All I'm seeing is how to set types in a directory to be forced? How can I force a type (mp3) to always use a forcedtype?

Here is an idea I have...

<Files *.mp3>
ForceType application/forcedownload
</Files>

John

coopster

3:05 pm on Jan 20, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



There is no option to truly *force a download* -- no headers or anything of that sort that will indeed make this happen. As jdMorgan stated, you can play around with the headers to try and fool a browser into a download, but that is about it.

The option to open or download is typically the user's choice. Your best option is to instruct a user how to download the file if anything. But can you force a download? Depends on the browser and the headers you send to it.

If you want the user to be prompted to save the data you are sending you can use the Content-Disposition [faqs.org] header to supply a recommended filename and possibly force the browser to display the save dialog.

coopster

3:25 pm on Jan 20, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



A relative discussion going on right now:

Link to download file - not open it automatically [webmasterworld.com]