class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
I can upload images fine, but for some reason not mp3s. I get an "error: Incorrect type of file" message. My php.ini file allows a max size of 10MB and the mp3 I try to upload is only 2MB.
Here is what I have:
$fileMP3 = new upload($_FILES['file_mp3']);
if ($fileMP3->uploaded) {
$fileMP3->allowed = array('audio/mp3','audio/wma');
$fileMP3->process('/home/mydir/public_html/uploads/');
}
if ($fileMP3->processed) {
echo 'Success';
$fileMP3->clean();
exit;
} else {
echo 'error : ' . $fileMP3->error;
exit;
}
where file_mp3 is the name of my form field. I assume the answer lies in the allowed mime-type but this seems to be correct. Is there something else I'm missing?
Here is what I have:
where file_mp3 is the name of my form field. I assume the answer lies in the allowed mime-type but this seems to be correct. Is there something else I'm missing?
Thanks,
Roger