You are here: Re: Upload file types « PHP Programming Language « IT news, forums, messages
Re: Upload file types

Posted by Gordon Burditt on 10/25/43 11:20

>I have upload working and the file type test has "audio/mid". I would also

This is a MIME type. You can do any test you want on it.

>like allow other types, say .wav for example. Is it simply a case of
>changing:
>
> if ($_FILES['filename']['type'] == "audio/mid") {
>
>to
>
> if (($_FILES['filename']['type'] == "audio/mid") ||
> ($_FILES['filename']['type'] == "audio/wav") ) {
>
>Is there a more compact way of doing it?
>
>Also, please help me understand the meaning of "audio/mid". Why is there
>the prequalifier of "audio/" and not simply have "mid"? I am sure this is
>**somewhere** in the manual, but I haven't located it as yet.

MIME types have a general class (text, audio, video, etc.) and a
specific format. It is common that something checking the type
is interested in the class but is not particular about the type.
This is particularly true for software that is not necessarily
updated every time someone comes up with a new type.

For example, a browser might send anything of class "audio" or
"video" to the application "mplayer", and let IT worry about whether
it can handle the specific type. Or it might handle a few specific
types that it knows about, e.g. audio/aac, with specific programs,
and let "mplayer" handle the remaining ones matching audio/* or
video/* .

Gordon L. Burditt

 

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

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