[solved]Weird problem upload routine.
Posted: Fri Nov 18, 2005 10:21 pm
Hi Guyz,
I've written an upload routine for MP3's. It's nothing special, but it seems that some people get an error (File is not an MP3) while the file is OK. When people send me the file through email and i upload it myself there isn't any problem and the routine works just fine. You can see the checking code below.
Anybody know of a glitch what can cause the above problem.
I've written an upload routine for MP3's. It's nothing special, but it seems that some people get an error (File is not an MP3) while the file is OK. When people send me the file through email and i upload it myself there isn't any problem and the routine works just fine. You can see the checking code below.
Anybody know of a glitch what can cause the above problem.
Code: Select all
if (is_uploaded_file($_FILES['mp3file']['tmp_name']))
{
$filetype = $_FILES['mp3file']['type'];
$filesize = $_FILES['mp3file']['size'];
$filename = $_FILES['mp3file']['name'];
if (($filetype == "audio/mpeg") || ($filetype == "audio/mpeg3") || ($filetype == "audio/x-mpeg-3"))
{
if (!ereg(".mp3",$filename))
{
Echo("Error wrong extension");
}
}
else
{
Echo("Error file is not a MP3");
}