Version: v0.7.0 - 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