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