src/Util/FileUtil.php
public static function guessMimeType($filename, $default = 'application/octed-stream')
    {
        $guesser = new FileExtMimeTypeGuesser();

        $mime = $guesser->guess($filename);
        if (null === $mime) {
            try {
                $mime = MimeTypeGuesser::getInstance()->guess($filename);
            } catch (FileNotFoundException $ex) {
                // dont care
            }
        }

        return null === $mime ? $default : $mime;
    }
public static function guessMimeType($filename, $default = 'application/octed-stream')
    {
        $guesser = new FileExtMimeTypeGuesser();

        $mime = $guesser->guess($filename);
        if (null === $mime) {
            try {
                $mime = MimeTypeGuesser::getInstance()->guess($filename);
            } catch (FileNotFoundException $ex) {
                // dont care
            }
        }

        return null === $mime ? $default : $mime;
    }
public static function guessMimeType ( $ filename , $ default = 'application/octed-stream' ) { $ guesser = new FileExtMimeTypeGuesser ( ) ; $ mime = $ guesser -> guess ( $ filename ) ; if ( null === $ mime ) { try { $ mime = MimeTypeGuesser :: getInstance ( ) -> guess ( $ filename ) ; } catch ( FileNotFoundException $ ex ) { // dont care } } return null === $ mime ? $ default : $ mime ; }
Guesses the mimetype by the files extension ... or default
@param string $filename
@param string $default
@return string
Guesses the mimetype by the files extension ... or default