Forum Moderators: phranque

Message Too Old, No Replies

Links to mp3 files cause default player to start

What I really want is for the file to be offered for download

         

GaryK

10:08 pm on Dec 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need to offer legitimately licensed mp3 files for download. The problem is when you offer up an mp3 link, at least in Windows, the file starts to play in your default player instead of the usual open/save/cancel box you normally get in IE so you can download the song.

Is there a way around this problem other than placing the songs in a container file like a zip file which would trigger a download?

Thanks.

bcolflesh

10:10 pm on Dec 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can send the browser a fake mime-type, this will force most of them to popup a download box - search Google for your particular scripting language and "force download".

panic

10:10 pm on Dec 18, 2003 (gmt 0)

10+ Year Member



It automatically plays when you've associated a certain program (Windows Media Player, Winamp, etc) with MP3's. If you want a user to download rather than stream it, put it in a zip file.

-p

GaryK

10:52 pm on Dec 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The zip option has been considered and is a last resort but I still appreciate the suggestion. I'm off to visit Ms. G. to see what secrets she'll give up about "force download."

UPDATE: bcolflesh, many thanks I found a page that gave me the exact VBScript I need to make this happen. Thanks VERY much.

panic

10:59 pm on Dec 18, 2003 (gmt 0)

10+ Year Member



The zip option has been considered and is a last resort but I still appreciate the suggestion. I'm off to visit Ms. G. to see what secrets she'll give up about "force download."

Ask Mr. I instead :)

plumsauce

5:46 am on Dec 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



consider using a "content-disposition" header.

GaryK

4:29 pm on Dec 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks everyone. Since bcolflesh's recommendation last night I found a code snippet that I was able to modify slightly to better work for my needs. The application I was working on is finished and was delivered to my client/friend this morning who is thrilled with it.

I'm not sure if I can post the URL to the site I found, but to me it is an authoritative source and worthy of note. This particular code snippet handles more than just mp3 files so it's valuable for lots of uses where you want to trigger a download instead of causing some default application to start on the user's PC. I have no relation to the site in question whatsoever.

If any mods disagree please feel free to de-link or delete the URL. If that happens I'll offer my apologies and be happy to pass the URL to anyone via StickyMail.

http://www.psacake.com/web/if.asp

[edited by: DaveAtIFG at 5:50 pm (utc) on Dec. 19, 2003]
[edit reason] DeLinked URL [/edit]