mime_content_type() returns empty string for AVI using PHP5

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • comp.lang.php

    mime_content_type() returns empty string for AVI using PHP5

    PHP 5.2.0

    when using mime_content_ty pe("/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

  • Rik

    #2
    Re: mime_content_ty pe() returns empty string for AVI using PHP5

    On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php
    <phillip.s.powe ll@gmail.comwro te:
    PHP 5.2.0
    >
    when using mime_content_ty pe("/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?


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



    HTH,
    --
    Rik Wasmus

    Comment

    • comp.lang.php

      #3
      Re: mime_content_ty pe() returns empty string for AVI using PHP5

      On Jul 4, 4:48 am, Rik <luiheidsgoe... @hotmail.comwro te:
      On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php
      >
      <phillip.s.pow. ..@gmail.comwro te:
      PHP 5.2.0
      >
      when using mime_content_ty pe("/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?
      >

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

      Comment

      • comp.lang.php

        #4
        Re: mime_content_ty pe() returns empty string for AVI using PHP5

        On Jul 4, 11:03 am, "comp.lang. php" <phillip.s.pow. ..@gmail.com>
        wrote:
        On Jul 4, 4:48 am, Rik <luiheidsgoe... @hotmail.comwro te:
        >
        >
        >
        On Wed, 04 Jul 2007 09:11:01 +0200, comp.lang.php
        >
        <phillip.s.pow. ..@gmail.comwro te:
        PHP 5.2.0
        >
        when using mime_content_ty pe("/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?
        >>
        "..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."
        >>
        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

        Comment

        Working...