package magic-mime

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

Module Mime_typesSource

Database of file extensions to MIME types from RFC2045 onwards.

Sourceval 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.

Sourceval 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.

Sourceval 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.

OCaml

Innovation. Community. Security.