This is a quick-and-dirty MIME type lookup based on this list: Incomplete list of MIME types.
include mvc/mimetype.e
public function get_mime_type( sequence path, sequence default = DEFAULT_MIME_TYPE )
Returns the MIME type for the given file path, based on its extension.
Parameters
path
- the file pathdefault
- the default MIME type, ``DEFAULT_MIME_TYPEis
"application/octet-stream"`
Notes
- You may want to specify
"text/plain"
asdefault
if you're sure your content is plain text.
Returns
The MIME type for the given file, or default
if the extension was not found.