Skip to content

Latest commit

 

History

History
27 lines (15 loc) · 823 Bytes

MIMETYPE.md

File metadata and controls

27 lines (15 loc) · 823 Bytes

MIME database

This is a quick-and-dirty MIME type lookup based on this list: Incomplete list of MIME types.

MIME routines

get_mime_type

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 path
  • default - the default MIME type, ``DEFAULT_MIME_TYPEis"application/octet-stream"`

Notes

  • You may want to specify "text/plain" as default 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.