MIME_TYPE

MIME type

Description

Returns the MIME type of the given file extension, or null if it cannot be determined. Also works with full paths and filenames, where it's assumed the string ends in an extension.

Function signature

MIME_TYPE(fileextension: String) => String

Parameter

Description

File extension

File extension

Examples

Formula

Return value

MIME_TYPE("json")

application/json

MIME_TYPE(".json")

application/json

MIME_TYPE("/cachedImages/test.png")

image/png

MIME_TYPE("README.md")

text/markdown