Lucu-1.0: Embedded HTTP Server

Network.HTTP.Lucu.MIMEType.Guess

Description

Guessing MIME Types by file extensions. It's not always accurate but simple and fast.

In general you don't have to use this module directly.

Synopsis

Documentation

newtype ExtMap Source

A Map from file extensions to MIMETypes.

Constructors

ExtMap (Map Text MIMEType) 

extMap :: QuasiQuoterSource

QuasiQuoter for ExtMap reading Apache mime.types.

   m :: ExtMap
   m = [extMap|
   # MIME Type            Extensions
   application/xhtml+xml  xhtml
   image/jpeg             jpeg jpg
   image/png              png
   image/svg+xml          svg
   text/html              html
   text/plain             txt
   |]

guessTypeByFileName :: ExtMap -> FilePath -> Maybe MIMETypeSource

Guess the MIME Type of a file.