Re: mime.magic adding more types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mark Steudel wrote:
> Hi there,
> 
> I'm writing some code that looks at a video file given to it and writes up
> the correct embed html and outputs it to the browser. I though that I would
> use mime_content_type() function to detect the type of each video, but after
> enabling it, I found that it doesn't have the mime type for windows media
> player. After some researching I had some following questions:
> 
> 1. Can someone explain what each column means in the magic.mime file:
> 
> 0	short		0143561		application/x-bcpio
> 
> 2. Does anyone have any windows media, realplayer mime types they'd like to
> share for the magic.mime file
> 
> 3. I saw that the mime_type extension have been deprecated in favor of pecl
> fileinfo, is installing and using the pecl extension as easy as pear install

I believe that it should be:

pecl install fileinfo

> fileinfo? Does it detect windows media, real player, and quicktime videos?

I have no idea. reading the source of the extension gives me the impression
that it may rely on the same magic.mime file you have been looking at (I
might very well be completely wrong) - at any rate it relies on some kind of
'mime db'

> 
> 4. Any other suggestions on detecting what type of video file is being
> processed? I suppose looking at file extensions is another method, though I
> like the idea of mime type detection over file extension examination.

looking at the file extension is a bit lame and definitely insecure ...
going the route of checking the mimetype (i.e. using code that actually checks
the file to try to determine what it is) would be the way to go.

then again maybe you could do both to cover all bases (e.g. file extension check fallback)?

[just thinking out loud]

> 
> Thanks, Mark
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux