W3cubDocs

/Symfony 4.1

MimeTypeExtensionGuesser

class MimeTypeExtensionGuesser implements ExtensionGuesserInterface

Provides a best-guess mapping of mime type to file extension.

Properties

protected $defaultExtensions A map of mime types and their default extensions.

Methods

string guess(string $mimeType)

Makes a best guess for a file extension, given a mime type.

Details

string guess(string $mimeType)

Makes a best guess for a file extension, given a mime type.

Parameters

string $mimeType The mime type

Return Value

string The guessed extension or NULL, if none could be guessed