mime-types-0.1.1.0: Basic mime-type handling types and functions
Safe Haskell Safe-Inferred
Language Haskell2010

Network.Mime

Synopsis

Lookups

mimeByExt Source #

Arguments

:: MimeMap
-> MimeType

default mime type

-> FileName
-> MimeType

Look up a mime type from the given mime map and default mime type.

defaultMimeLookup :: FileName -> MimeType Source #

mimeByExt applied to defaultMimeType and defaultMimeMap .

Defaults

defaultMimeType :: MimeType Source #

The default fallback mime type "application/octet-stream".

defaultMimeMap :: MimeMap Source #

A default mapping from filename extension to mime type.

Generated from the Apache and nginx mime.types files.

Utilities

fileNameExtensions :: FileName -> [ Extension ] Source #

Get a list of all of the file name extensions.

fileNameExtensions "foo.tar.gz" == ["tar.gz", "gz"]

Types

type FileName = Text Source #

The filename component of a filepath, leaving off the directory but keeping all extensions.

type MimeType = ByteString Source #

Individual mime type for be served over the wire.

type MimeMap = Map Extension MimeType Source #

Maps extensions to mime types.

type Extension = Text Source #

Path extension. May include multiple components, e.g. tar.gz