mime_content_type() returns empty string for AVI using PHP5

PHP 5.2.0

when using mime_content_type("/path/to/my/video.avi")

I get an empty string every time

When I am supposed to get

video/x-msvideo

What is going on?

Thanks
Phil
phillip.s.powell [ Mi, 04 Juli 2007 09:11 ] [ ID #1759609 ]

Re: mime_content_type() returns empty string for AVI using PHP5

On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php
<phillip.s.powell [at] gmail.com> wrote:

> PHP 5.2.0
>
> when using mime_content_type("/path/to/my/video.avi")
>
> I get an empty string every time
>
> When I am supposed to get
>
> video/x-msvideo
>
> What is going on?

http://www.php.net/mime_content_type

"..as determined by using information from the _magic.mime_ file.."

which is by no means 100%, or even very reliable.

Also:
"This function has been deprecated as the PECL extension Fileinfo provides
the same functionality (and more) in a much cleaner way."

http://www.php.net/manual/en/ref.fileinfo.php

HTH,
--
Rik Wasmus
luiheidsgoeroe [ Mi, 04 Juli 2007 10:48 ] [ ID #1759610 ]

Re: mime_content_type() returns empty string for AVI using PHP5

On Jul 4, 4:48 am, Rik <luiheidsgoe... [at] hotmail.com> wrote:
> On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php
>
> <phillip.s.pow... [at] gmail.com> wrote:
> > PHP 5.2.0
>
> > when using mime_content_type("/path/to/my/video.avi")
>
> > I get an empty string every time
>
> > When I am supposed to get
>
> > video/x-msvideo
>
> > What is going on?
>
> http://www.php.net/mime_content_type
>
> "..as determined by using information from the _magic.mime_ file.."
>
> which is by no means 100%, or even very reliable.

Considering there's an entry for AVI in magic.mime for PHP and for
Apache. :(

>
> Also:
> "This function has been deprecated as the PECL extension Fileinfo provides
> the same functionality (and more) in a much cleaner way."
>
> http://www.php.net/manual/en/ref.fileinfo.php

Hmm.. might be an option thanx!

>
> HTH,
> --
> Rik Wasmus
phillip.s.powell [ Mi, 04 Juli 2007 17:03 ] [ ID #1759611 ]

Re: mime_content_type() returns empty string for AVI using PHP5

On Jul 4, 11:03 am, "comp.lang.php" <phillip.s.pow... [at] gmail.com>
wrote:
> On Jul 4, 4:48 am, Rik <luiheidsgoe... [at] hotmail.com> wrote:
>
>
>
> > On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php
>
> > <phillip.s.pow... [at] gmail.com> wrote:
> > > PHP 5.2.0
>
> > > when using mime_content_type("/path/to/my/video.avi")
>
> > > I get an empty string every time
>
> > > When I am supposed to get
>
> > > video/x-msvideo
>
> > > What is going on?
>
> >http://www.php.net/mime_content_type
>
> > "..as determined by using information from the _magic.mime_ file.."
>
> > which is by no means 100%, or even very reliable.
>
> Considering there's an entry for AVI in magic.mime for PHP and for
> Apache. :(
>
>
>
> > Also:
> > "This function has been deprecated as the PECL extension Fileinfo provides
> > the same functionality (and more) in a much cleaner way."
>
> >http://www.php.net/manual/en/ref.fileinfo.php
>
> Hmm.. might be an option thanx!

Sorry I was wrong, not an option. Apparently it relies upon /etc/
magic.mime, which of course there is no Windows equivalent, nor does
it seem that PECL's fileinfo have any Windows support according to the
user notes that I could find

>
>
>
> > HTH,
> > --
> > Rik Wasmus
phillip.s.powell [ Mi, 04 Juli 2007 17:29 ] [ ID #1759612 ]

Re: mime_content_type() returns empty string for AVI using PHP5

On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php
<phillip.s.powell [at] gmail.com> wrote:

> PHP 5.2.0
>
> when using mime_content_type("/path/to/my/video.avi")
>
> I get an empty string every time
>
> When I am supposed to get
>
> video/x-msvideo
>
> What is going on?

http://www.php.net/mime_content_type

"..as determined by using information from the _magic.mime_ file.."

which is by no means 100%, or even very reliable.

Also:
"This function has been deprecated as the PECL extension Fileinfo provides
the same functionality (and more) in a much cleaner way."

http://www.php.net/manual/en/ref.fileinfo.php

HTH,
--
Rik Wasmus
luiheidsgoeroe [ Mi, 04 Juli 2007 10:48 ] [ ID #1759646 ]

Re: mime_content_type() returns empty string for AVI using PHP5

On Jul 4, 4:48 am, Rik <luiheidsgoe... [at] hotmail.com> wrote:
> On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php
>
> <phillip.s.pow... [at] gmail.com> wrote:
> > PHP 5.2.0
>
> > when using mime_content_type("/path/to/my/video.avi")
>
> > I get an empty string every time
>
> > When I am supposed to get
>
> > video/x-msvideo
>
> > What is going on?
>
> http://www.php.net/mime_content_type
>
> "..as determined by using information from the _magic.mime_ file.."
>
> which is by no means 100%, or even very reliable.

Considering there's an entry for AVI in magic.mime for PHP and for
Apache. :(

>
> Also:
> "This function has been deprecated as the PECL extension Fileinfo provides
> the same functionality (and more) in a much cleaner way."
>
> http://www.php.net/manual/en/ref.fileinfo.php

Hmm.. might be an option thanx!

>
> HTH,
> --
> Rik Wasmus
phillip.s.powell [ Mi, 04 Juli 2007 17:03 ] [ ID #1759656 ]

Re: mime_content_type() returns empty string for AVI using PHP5

On Jul 4, 11:03 am, "comp.lang.php" <phillip.s.pow... [at] gmail.com>
wrote:
> On Jul 4, 4:48 am, Rik <luiheidsgoe... [at] hotmail.com> wrote:
>
>
>
> > On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php
>
> > <phillip.s.pow... [at] gmail.com> wrote:
> > > PHP 5.2.0
>
> > > when using mime_content_type("/path/to/my/video.avi")
>
> > > I get an empty string every time
>
> > > When I am supposed to get
>
> > > video/x-msvideo
>
> > > What is going on?
>
> >http://www.php.net/mime_content_type
>
> > "..as determined by using information from the _magic.mime_ file.."
>
> > which is by no means 100%, or even very reliable.
>
> Considering there's an entry for AVI in magic.mime for PHP and for
> Apache. :(
>
>
>
> > Also:
> > "This function has been deprecated as the PECL extension Fileinfo provides
> > the same functionality (and more) in a much cleaner way."
>
> >http://www.php.net/manual/en/ref.fileinfo.php
>
> Hmm.. might be an option thanx!

Sorry I was wrong, not an option. Apparently it relies upon /etc/
magic.mime, which of course there is no Windows equivalent, nor does
it seem that PECL's fileinfo have any Windows support according to the
user notes that I could find

>
>
>
> > HTH,
> > --
> > Rik Wasmus
phillip.s.powell [ Mi, 04 Juli 2007 17:29 ] [ ID #1759659 ]
PHP » alt.php » mime_content_type() returns empty string for AVI using PHP5

Vorheriges Thema: change a code that work for merge but not for intersect
Nächstes Thema: array new also if used