|
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]
|