Module mimerl

Function Index

extension/1Transform an extension to a mimetype.
filename/1Return the mimetype for any file by looking at its extension.
mime_to_exts/1Return the list of extensions for a mimetype.
web/1
web_extension/1transform a web extension to a mimetype.

Function Details

extension/1

extension(Ext::binary()) -> binary()

Transform an extension to a mimetype

Example:

  1> mimerl:extension(<<"c">>).
  <<"text/x-c">>

filename/1

filename(Path::file:filename_all()) -> binary()

Return the mimetype for any file by looking at its extension. Example:

  1> mimerl:filename(<<"test.cpp">>).
  <<"text/x-c">>

mime_to_exts/1

mime_to_exts(Mimetype::binary()) -> [binary()]

Return the list of extensions for a mimetype. Example:

  1> mimerl:mime_to_exts(<<"text/plain">>).
  [<<"txt">>,<<"text">>,<<"conf">>,<<"def">>,<<"list">>,<<"log">>,<<"in">>]

web/1

web(Path) -> any()

web_extension/1

web_extension(Ext) -> any()

transform a web extension to a mimetype


Generated by EDoc