Fork me on GitHub

Module ringo/webapp/fileupload

Functions


BufferFactory (data, encoding)

A stream factory that stores file upload in a memory buffer. This function is not meant to be called directly but to be passed as streamFactory argument to parseFileUpload().

The buffer is stored in the value property of the parameter's data object.

Parameters

data
encoding

TempFileFactory (data, encoding)

A stream factory that stores file uploads in temporary files. This function is not meant to be called directly but to be passed as streamFactory argument to parseFileUpload().

The name of the temporary file is stored in the tempfile property of the parameter's data object.

Parameters

data
encoding

isFileUpload (contentType)

Find out whether the content type denotes a format this module can parse.

Parameters

contentType a HTTP request Content-Type header

Returns

true if the content type can be parsed as form data by this module

parseFileUpload (request, params, encoding, streamFactory)

Parses a multipart MIME input stream. Parses a multipart MIME input stream.

Parameters

request the JSGI request object
params the parameter object to parse into
encoding the encoding to apply to non-file parameters
streamFactory factory function to create streams for mime parts