static public function guessByMimeType($mimeType)
    {
        switch (substr($mimeType, 0, strpos($mimeType, '/'))) {
            case 'audio' : return self::AUDIO; break;
            case 'image' : return self::IMAGE; break;
            case 'video' : return self::VIDEO; break;
        }

        if (preg_match('~zip|rar|compress~', $mimeType)) {
            return self::ARCHIVE;
        }

        if ($mimeType === 'application/x-shockwave-flash') {
            return self::FLASH;
        }

        return self::FILE;
    }
static public function guessByMimeType($mimeType)
    {
        switch (substr($mimeType, 0, strpos($mimeType, '/'))) {
            case 'audio' : return self::AUDIO; break;
            case 'image' : return self::IMAGE; break;
            case 'video' : return self::VIDEO; break;
        }

        if (preg_match('~zip|rar|compress~', $mimeType)) {
            return self::ARCHIVE;
        }

        if ($mimeType === 'application/x-shockwave-flash') {
            return self::FLASH;
        }

        return self::FILE;
    }
static public function guessByMimeType ( $ mimeType ) { switch ( substr ( $ mimeType , 0 , strpos ( $ mimeType , '/' ) ) ) { case 'audio' : return self :: AUDIO ; break ; case 'image' : return self :: IMAGE ; break ; case 'video' : return self :: VIDEO ; break ; } if ( preg_match ( '~zip|rar|compress~' , $ mimeType ) ) { return self :: ARCHIVE ; } if ( $ mimeType === 'application/x-shockwave-flash' ) { return self :: FLASH ; } return self :: FILE ; }
Guess the type by mime type.

@param $mimeType
@return string
Guess the type by mime type .