aliyun v1.0.11 Aliyun.OSS.Mime

Maps MIME types to file extensions and vice versa.

Link to this section Summary

Functions

Returns the extensions associated with a MIME type. iex> MIME.Types.extensions(“text/html”) [“html”, “htm”]

Guesses the MIME type based on the path’s extension. iex> MIME.Types.path(“index.html”) “text/html”

Returns the MIME type associated with a file extension. iex> MIME.Types.type(“txt”) “text/plain”

Returns whether a MIME type is registered. iex> MIME.Types.valid?(“text/plain”) true

Link to this section Functions

Link to this function extensions(type)
extensions(String.t()) :: [String.t()]

Returns the extensions associated with a MIME type. iex> MIME.Types.extensions(“text/html”) [“html”, “htm”]

Link to this function path(path)
path(Path.r()) :: String.t()

Guesses the MIME type based on the path’s extension. iex> MIME.Types.path(“index.html”) “text/html”

Link to this function type(arg1)
type(String.t()) :: String.t()

Returns the MIME type associated with a file extension. iex> MIME.Types.type(“txt”) “text/plain”

Link to this function valid?(type)
valid?(String.t()) :: boolean()

Returns whether a MIME type is registered. iex> MIME.Types.valid?(“text/plain”) true