Jump to content

Php Download File Script, Needs More Work ?


Mancent

Recommended Posts

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.