package magic-mime

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Database of file extensions to MIME types from RFC2045 onwards.

val map_extension : ?default:string -> string -> string

map_extension ~default e converts the file extension e into a MIME type, defaulting to default (which is application/octet-stream by default) if it is unknown.

val map_file : ?default:string -> string -> string

map_file ~default f converts the filename f into a MIME type, defaulting to default (which is application/octet-stream by default) if it is unknown.

val map_mime : string -> string list

map_mime m converts the MIME type m into a list of acceptable file extensions, defaulting to an empty list if it is unknown.