Mancent Posted December 2, 2012 Share Posted December 2, 2012 Hi. Ok I have this script I am working on, so I can download any file from my site to my computer.. I am trying to make a ring tone system. I have the uploader that allows the user to upload a ringtone in file format mp3 reasons being mp3 streams, so the other users can hear the ringtone on the site. and this is the download script.. <? $filename = $_GET['filename']; $ext = $_GET['ext']; if(empty($filename)) { exit(); } else { $test=explode(".", $filename); $file_extension = strtolower(substr(strrchr($filename,"."),1)); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); header("Content-Type: $ctype"); header("Content-Disposition: attachment; filename=\"".basename($filename.$ext)."\";" ); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($filename)); readfile("$filename"); exit(); } ?> So we know the file that was uploaded was a mp3, but the file we need for our phone is not a mp3, say we have a Iphone and the file format is .m4r I thought just rename the ext. from filename.mp3 to filename.m4r and i thought that just might work, but it will not! so i have to add a converter here some how preview of the ringtones uploaded are here http://wiistream.com just hit the ringtone button in the header. I have two they are mp3 but if you click the download button it opens the choice system, that lets you pic the ext format ext. would any one be willing to help finish this part out I need to know how to convert maybe ffmpeg i need help with this! Quote Link to comment https://forums.phpfreaks.com/topic/271466-php-download-file-script-needs-more-work/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.