EllaSource codeContentsIndex
Ella.CGI.Multipart
Portabilitynon-portable
Stabilityexperimental
Maintainerbjorn@bringert.net
Contents
Multi-part messages
Headers
Description

Parsing of the multipart format from RFC2046. Partly based on code from WASHMail.

Copied directly from the CGI package -- it cannot be imported as this module is not exposed

Synopsis
data MultiPart = MultiPart [BodyPart]
data BodyPart = BodyPart Headers ByteString
parseMultipartBody :: String -> ByteString -> MultiPart
hGetMultipartBody :: String -> Handle -> IO MultiPart
showMultipartBody :: String -> MultiPart -> ByteString
data ContentType = ContentType {
ctType :: String
ctSubtype :: String
ctParameters :: [(String, String)]
}
data ContentTransferEncoding = ContentTransferEncoding String
data ContentDisposition = ContentDisposition String [(String, String)]
parseContentType :: Monad m => String -> m ContentType
getContentType :: Monad m => Headers -> m ContentType
getContentTransferEncoding :: Monad m => Headers -> m ContentTransferEncoding
getContentDisposition :: Monad m => Headers -> m ContentDisposition
Multi-part messages
data MultiPart Source
Constructors
MultiPart [BodyPart]
show/hide Instances
data BodyPart Source
Constructors
BodyPart Headers ByteString
show/hide Instances
parseMultipartBodySource
:: StringBoundary
-> ByteString
-> MultiPart
Read a multi-part message from a ByteString.
hGetMultipartBodySource
:: StringBoundary
-> Handle
-> IO MultiPart
Read a multi-part message from a Handle. Fails on parse errors.
showMultipartBody :: String -> MultiPart -> ByteStringSource
Headers
data ContentType Source
A MIME media type value. The Show instance is derived automatically. Use showContentType to obtain the standard string representation. See http://www.ietf.org/rfc/rfc2046.txt for more information about MIME media types.
Constructors
ContentType
ctType :: StringThe top-level media type, the general type of the data. Common examples are "text", "image", "audio", "video", "multipart", and "application".
ctSubtype :: StringThe media subtype, the specific data format. Examples include "plain", "html", "jpeg", "form-data", etc.
ctParameters :: [(String, String)]Media type parameters. On common example is the charset parameter for the "text" top-level type, e.g. ("charset","ISO-8859-1").
show/hide Instances
data ContentTransferEncoding Source
Constructors
ContentTransferEncoding String
show/hide Instances
data ContentDisposition Source
Constructors
ContentDisposition String [(String, String)]
show/hide Instances
parseContentType :: Monad m => String -> m ContentTypeSource
Parse the standard representation of a content-type. If the input cannot be parsed, this function calls fail with a (hopefully) informative error message.
getContentType :: Monad m => Headers -> m ContentTypeSource
getContentTransferEncoding :: Monad m => Headers -> m ContentTransferEncodingSource
getContentDisposition :: Monad m => Headers -> m ContentDispositionSource
Produced by Haddock version 2.4.2