|
Posted by Andy Hassall on 10/27/33 11:22
On Tue, 26 Jul 2005 16:34:01 GMT, "Shelly" <sheldonlg.news@asap-consult.com>
wrote:
>Now I ask if there is a similar function call for audio types. I want to be
>able to verify that the file I upload is, indeed, an audio file. 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.
There's the "mime magic" function:
http://uk2.php.net/mime_content_type
... which looks for magic numbers in the file to make a decent guess as to
what format a file is. Not foolproof, but generally reasonable.
The other alternative is presumably doing full parsing of the audio file
itself to look for known structures for the audio formats you're expecting.
--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Navigation:
[Reply to this message]
|