PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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.
Thank you so much for the reply. Again I am new to PHP and probably am missing something really basic. I have inserted the PHP code from above that you offered and when I click on it to download it brings up the option box to save/open but it is saying that is downloading a PHP file instead of the mp3 that I want it to download. Your note mentions the .mp3 file name, do I need to put the web address of the mp3 file there? Do I need to insert the file name anywhere else in the code. If you wouldn't mind could you create mock up code with a fake .mp3 file that I could easily follow and know where I need to make inserts of my own in the code? Understand if not, but would appreciate the help greatly! Thanks again for the reply and for your time!
thank you so much! the code works perfectly on all the machines that I have tried it on. All I had wrong was on the link that I had coded it didn't match up with y our code properly. Once I fixed that it was good to go. I really appreciate you taking the time to help me out!