This module parses the etcmime.types file, commonly found on UNIX systems. This file provides a mapping from file extension to MIME type.
- parseMimeTypes :: String -> IO (Map ByteString MediaType)
- parseMimeTypesTotal :: String -> IO (Maybe (Map ByteString MediaType))
Documentation
parseMimeTypes :: String -> IO (Map ByteString MediaType)Source
Parse the given filename as a mime.types file and return a map from file extension to mime type.
parseMimeTypesTotal :: String -> IO (Maybe (Map ByteString MediaType))Source
Same as parseMimeTypes
, but never throw an exception, return a Nothing
instead.