Class luci.http.mime

Functions

to_ext (mimetype) Return corresponding extension for a given mime type or nil if the given mime-type is unknown.
to_mime (filename) Extract extension from a filename and return corresponding mime-type or "application/octet-stream" if the extension is unknown.


Functions

to_ext (mimetype)
Return corresponding extension for a given mime type or nil if the given mime-type is unknown.

Parameters

  • mimetype: The mimetype to retrieve the extension from

Return value:

String with the extension or nil for unknown type
to_mime (filename)
Extract extension from a filename and return corresponding mime-type or "application/octet-stream" if the extension is unknown.

Parameters

  • filename: The filename for which the mime type is guessed

Return value:

String containign the determined mime type

Valid XHTML 1.0!