Hello,
I am creating a function to validate filetypes when they are uploaded from a form, and i can not get around the folowing problem:
when i POST an .mp3 file using FF3.0.5 on Windows, then:
mime_content_type($_FILES['file']['tmp_name']) func returns: "audio/mpeg". That's ok.
But the $_FILES['file']['type'] contains "application/download".
IE works fine.
Is there anything i can do about that? Or what do you think if i let $_FILES['file']['type'] to be "application/download" when the file extension is mp3?
Oh, PHP Version 5.2.6
(Btw, i know instead of mime_content_type() i should use finfo_...(), but i can not get that func work on my local PC.)
mp3 MIMEType from FireFox 3 is application/download
Moderator: General Moderators
Re: mp3 MIMEType from FireFox 3 is application/download
Well a hackish way to work around it would be too....
Code: Select all
if(preg_match("/^.*\.(mp3)$/i", $filename)) {
// Overide the default value
$_FILES['file']['type'] = "audio/mpeg";
}
Re: mp3 MIMEType from FireFox 3 is application/download
Ye, i think thats the best i can do.
Thank you for the idea
Thank you for the idea