Problems with MP3 downloading?
Posted: Tue May 24, 2005 10:01 am
I am trying to make an a mp3 download by using flash and PHP is what I am using to force the download. I have been all over Flash forums and no one can give a straight answer or has the PHP knowledge to help me. So i thought I would come to a PHP forum for help. I am very very limited in my understanding of PHP and this is only my second or third time using it. I am a Flash guy and designer. So I apologize for anything basic or stupid that I might ask or any posting errors.
My problem is when i click the button that is calling the PHP code up it will open the download/open/save as box and then when I choose save it will save the MP3 file to the desktop. But somewhere in the download it corrupts or destroys the file. It then puts a file that is 1KB or something small like (the file is several MB) that on the desktop. Windows media player, iTunes or whatever will not play the file. The second thing that I am confused about is that the code will not work in IE but will work perfectly in Firefox. Can anyone let me know what might be wrong with the PHP code. I figure the problem lies with the PHP code because it works in Firefox and not in IE so there is something that I a do not know about IE that is the problem. Please let me know what the problem could be. I will post my FLASH code for anyone who might also have know flash that might be able to help! your time is much appreciated.
The MP3 file name is spirit.mp3
The flash code looks like so...
on (release) {
getURL("download.php?f=spirit");
}
Many thanks!
My problem is when i click the button that is calling the PHP code up it will open the download/open/save as box and then when I choose save it will save the MP3 file to the desktop. But somewhere in the download it corrupts or destroys the file. It then puts a file that is 1KB or something small like (the file is several MB) that on the desktop. Windows media player, iTunes or whatever will not play the file. The second thing that I am confused about is that the code will not work in IE but will work perfectly in Firefox. Can anyone let me know what might be wrong with the PHP code. I figure the problem lies with the PHP code because it works in Firefox and not in IE so there is something that I a do not know about IE that is the problem. Please let me know what the problem could be. I will post my FLASH code for anyone who might also have know flash that might be able to help! your time is much appreciated.
Code: Select all
<?
Header( "Content-type: audio/mp3");
header("Content-Disposition: attachment; filename=\"".$HTTP_GET_VARS["f"] . ".mp3"."\"");
include("../Audio/".$HTTP_GET_VARS["f"] . ".mp3");
?>The flash code looks like so...
on (release) {
getURL("download.php?f=spirit");
}
Many thanks!