function MimeTypeMapInterface::getMimeTypeForExtension

Returns the appropriate MIME type for a given file extension.

Parameters

string $extension: A file extension, without leading dot.

Return value

string|null A matching MIME type, or NULL if no MIME type matches the extension.

File

core/lib/Drupal/Core/File/MimeType/MimeTypeMapInterface.php, line 95

Class

MimeTypeMapInterface
Provides an interface for MIME type to file extension mapping.

Namespace

Drupal\Core\File\MimeType

Code

public function getMimeTypeForExtension(string $extension) : ?string;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.