couchex v0.7.0 Couchex.MIME
Maps MIME types to file extensions and vice versa.
Summary
Functions
Returns the extensions associated with a given MIME type
Guesses the MIME type based on the path’s extension. See type/1
Returns the MIME type associated with a file extension. If no MIME type is
known for file_extension
, "application/octet-stream"
is returned
Returns whether a MIME type is registered
Functions
Returns the extensions associated with a given MIME type.
Examples
iex> Couchex.MIME.extensions("text/html")
["html", "htm"]
iex> Couchex.MIME.extensions("application/json")
["json"]
iex> Couchex.MIME.extensions("foo/bar")
[]
Guesses the MIME type based on the path’s extension. See type/1
.
Examples
iex> Couchex.MIME.path("index.html")
"text/html"
Returns the MIME type associated with a file extension. If no MIME type is
known for file_extension
, "application/octet-stream"
is returned.
Examples
iex> Couchex.MIME.type("txt")
"text/plain"
iex> Couchex.MIME.type("foobarbaz")
"application/octet-stream"