extension/1 | Transform an extension to a mimetype. |
filename/1 | Return the mimetype for any file by looking at its extension. |
mime_to_exts/1 | Return the list of extensions for a mimetype. |
extension(Ext::binary()) -> binary()
Transform an extension to a mimetype
Example:
1> mimetypes:extension(<<"c">>).
<<"text/x-c">>
filename(Path::file:filename_all()) -> binary()
Return the mimetype for any file by looking at its extension. Example:
1> hackney_mimetypes:filename(<<"test.cpp">>).
<<"text/x-c">>
mime_to_exts(Mimetype::binary()) -> [binary()]
Return the list of extensions for a mimetype. Example:
1> hackney_mimetypes:mime_to_exts(<<"text/plain">>).
[<<"txt">>,<<"text">>,<<"conf">>,<<"def">>,<<"list">>,<<"log">>,<<"in">>]