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