Common Lisp Package: CLACK.UTIL.RFC2388

# Clack.Util.Rfc2388 - Ported from RFC2388. ## DESCRIPTION `rfc2388:parse-mime` requires Hunchentoot package to parse multipart/form-data. This package provides a method `parse-mime` only for Clack. ## AUTHOR * Eitarow Fukamachi (e.arrows@gmail.com)

README:

FUNCTION

Private

MAKE-TMP-FILE-NAME (&OPTIONAL (PREFIX clack))

Generates a unique name for a temporary file.

PARSE-CONTENT-TYPE (STRING)

Returns content-type which is parsed from STRING.

READ-UNTIL-NEXT-BOUNDARY (STREAM BOUNDARY &OPTIONAL DISCARD OUT-STREAM)

Reads from STREAM up to the next boundary. Returns two values: read data (nil if DISCARD is true), and true if the boundary is not last (i.e., there's more data).

GENERIC-FUNCTION

Public

PARSE-MIME (SOURCE BOUNDARY &KEY WRITE-CONTENT-TO-FILE (WRITE-CONTENT-TO-FILE T))

Parses MIME entities, returning them as a list. Each element in the list is of form: (body headers), where BODY is the contents of MIME part, and HEADERS are all headers for that part. BOUNDARY is a string used to separate MIME entities.