Plug.MIME
Maps MIME types to file extensions and vice versa.
Summary
extensions(type) | Returns the extensions associated with a MIME type |
path(path) | Guesses the MIME type based on the path’s extension |
type(arg1) | Returns the MIME type associated with a file extension |
valid?(type) | Returns whether a MIME type is registered |
Functions
Specs:
Returns the extensions associated with a MIME type.
iex> Plug.MIME.extensions("text/html")
["html", "htm"]
Specs:
Guesses the MIME type based on the path’s extension.
iex> Plug.MIME.path("index.html")
"text/html"
Specs:
Returns the MIME type associated with a file extension.
iex> Plug.MIME.type("txt")
"text/plain"