|
Posted by John Dunlop on 10/20/28 11:22
Shelly wrote:
> I want to be able to verify that the file I upload is, indeed, an audio file.
You might look into
http://pecl.php.net/package/fileinfo
or as Andy said, mime_content_type(), which the Manual appears
to have deprecated now and you appear not to have available
right away.
> I would like this function because I am reasoning that if the "type" obtained
> from $_FILES['the_field_name']['type'] is not reliable for images, then it
> probably isn't reliable for audio either.
It's 'not reliable' only insofar as it's straightforward for
somebody to send strange values, or the browser might be
unable to guess the intended type, or the browser might decide
not to give you a Content-Type at all. I would imagine it's
fairly accurate more often than not, although that's not to
say I wouldn't recommend performing further checks.
--
Jock
Navigation:
[Reply to this message]
|