public static function getMediaTypeFromFilename(string $filename): string
    {
        $pathinfo = pathinfo(strtolower($filename));
        if (!isset($pathinfo['extension'])) {
            return 'application/octet-stream';
        }
        return self::$extensionToMediaType[$pathinfo['extension']] ?? 'application/octet-stream';
    }
public static function getMediaTypeFromFilename(string $filename): string
    {
        $pathinfo = pathinfo(strtolower($filename));
        if (!isset($pathinfo['extension'])) {
            return 'application/octet-stream';
        }
        return self::$extensionToMediaType[$pathinfo['extension']] ?? 'application/octet-stream';
    }
public static function getMediaTypeFromFilename ( string $ filename ) : string { $ pathinfo = pathinfo ( strtolower ( $ filename ) ) ; if ( ! isset ( $ pathinfo [ 'extension' ] ) ) { return 'application/octet-stream' ; } return self :: $ extensionToMediaType [ $ pathinfo [ 'extension' ] ] ?? 'application/octet-stream' ; }
Returns a Media Type based on the filename extension

@param  string $filename Filename to determine the media type for, for example "index.html"
@return string The IANA Internet Media Type
@api
Returns a Media Type based on the filename extension