You are here: Re: Audio type « PHP Programming Language « IT news, forums, messages
Re: Audio type

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация