\Symfony\Component\HttpFoundation\File\MimeTypeMimeTypeGuesserInterface

Guesses the mime type of a file.

Summary

Methods
Constants
guess()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

guess()

guess(string  $path) : string

Guesses the mime type of the file with the given path.

Parameters

string $path

The path to the file

Throws

\Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException

If the file does not exist

\Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException

If the file could not be read

Returns

string —

The mime type or NULL, if none could be guessed