File.mimeType

Returns the mime type of the file.

The mime type is guessed using a MimeTypeGuesserInterface instance, which uses finfo_file() then the "file" system binary, depending on which of those are available.

@return string|null The guessed mime type (e.g. "application/pdf")

@see MimeTypes

class File
string
mimeType
()

Meta