Version: v0.8.1 - Beta.  We welcome contributors & feedback.

File.mimeTypeToExtension

File.mimeTypeToExtension($mimeType) -> string

Description

Infer the file extension for the given MIME type.

If the MIME type is unknown, it returns ''.

File.mimeTypeToExtension('image/png')
//= 'png'

File.extensionToMimeType('text/html')
//= 'html'

File.extensionToMimeType('some/application')
//= ''

See Also