PDA

View Full Version : download mp3's



apostrophe
April 19th, 2003, 05:47 PM
when clicking on a link for an mp3 (www.mywebsite.com/song.mp3) on my website, the mp3 plays in my I.E. explorer window because it is set as my default. I assume that most visitors to the site will have a pre-set application to run mp3's. Is there a way to force the mp3 to actually download instead of running the 3rd party application? I want the pop-up box to appear on all users allowing them the option of saving it to their harddrive. I can achieve this by .rar or .zip, but I would prefer not to go this route.

Any suggestions?

Thanks,

'pos

reverendflash
April 19th, 2003, 05:50 PM
nope...

any wierd extension will prompt to save, etc. tho... just put a note to change extension after download...

example: MyMp3.dgo

Revhttp://www.aulman.com/rev.gif

kode
April 19th, 2003, 06:21 PM
i know you can force a download with server side scripting (ie. php). but i'm not sure how to do that. :-\

you should run a search at google.com. ;)

eyezberg
April 20th, 2003, 02:47 AM
General idea is something like this (which is just a quick copy/paste from a script i use to push back a server generated pdf..)

<?
header("Content-Type: application/octet-stream; name=".$HTTP_POST_VARS["filename"]);
header("Content-length: " . strlen($HTTP_POST_VARS["pdfdata"]));
header("Content-Transfer-Encoding: binary");
header("Accept-Ranges: none");
header("Content-Disposition: attachment; filename=".$HTTP_POST_VARS["filename"]."\n");
echo $HTTP_POST_VARS["pdfdata"];
?>