(byte-array-store)Returns a function that stores multipart file parameters as an array of bytes. The multipart parameters will be stored as maps with the following keys:
:filename - the name of the uploaded file :content-type - the content type of the uploaded file :bytes - an array of bytes containing the uploaded content
Returns a function that stores multipart file parameters as an array of bytes. The multipart parameters will be stored as maps with the following keys: :filename - the name of the uploaded file :content-type - the content type of the uploaded file :bytes - an array of bytes containing the uploaded content
(multipart-form? request)Returns true if the request is a multipart form request
Returns true if the request is a multipart form request
(multipart-params-request request)(multipart-params-request request options)Adds :multipart-params and :params keys to request by parsing multipart/form-data body. Based on ring's API but bb compatible.
Options: :encoding - Forced character encoding for fields. Overrides part Content-Type. :fallback-encoding - Encoding used if part has no Content-Type charset. Defaults to request encoding or UTF-8. :store - Function to handle file uploads. Takes map with :filename, :content-type, :stream, :part-headers. Default is the temp-file-store. For in-memory storage use the byte-array-store function. :progress-fn - a function that gets called during uploads. The function should expect four parameters: request, bytes-read, content-length, and item-count.
Adds :multipart-params and :params keys to request by parsing
multipart/form-data body. Based on ring's API but bb compatible.
Options:
:encoding - Forced character encoding for fields. Overrides part Content-Type.
:fallback-encoding - Encoding used if part has no Content-Type charset. Defaults
to request encoding or UTF-8.
:store - Function to handle file uploads. Takes map with
:filename, :content-type, :stream, :part-headers.
Default is the temp-file-store. For in-memory storage use
the byte-array-store function.
:progress-fn - a function that gets called during uploads. The
function should expect four parameters: request,
bytes-read, content-length, and item-count.Returns a function that stores multipart file parameters as temporary files. Accepts the following options:
:expires-in - delete temporary files older than this many seconds (defaults to 3600 - 1 hour)
The multipart parameters will be stored as maps with the following keys:
:filename - the name of the uploaded file :content-type - the content type of the upload file :tempfile - a File object that points to the temporary file containing the uploaded data :size - the size in bytes of the uploaded data
Returns a function that stores multipart file parameters as temporary files.
Accepts the following options:
:expires-in - delete temporary files older than this many seconds
(defaults to 3600 - 1 hour)
The multipart parameters will be stored as maps with the following keys:
:filename - the name of the uploaded file
:content-type - the content type of the upload file
:tempfile - a File object that points to the temporary file containing
the uploaded data
:size - the size in bytes of the uploaded data(wrap-multipart-params handler)(wrap-multipart-params handler options)Middleware to parse multipart parameters from a request. Adds the following keys to the request map:
:multipart-params - a map of multipart parameters from the request body. :params - merges multipart-params into existing :params.
Accepts the following options:
:encoding - Forced character encoding for fields. Overrides part Content-Type. :fallback-encoding - Encoding used if part has no Content-Type charset. Defaults to request encoding or UTF-8. :store - Function to handle file uploads. Takes map with :filename, :content-type, :stream, :part-headers. Default is the temp-file-store. For in-memory storage use the byte-array-store function. :progress-fn - Function called during uploads with parameters: request, bytes-read, content-length, item-count.
Throws on parsing errors.
Middleware to parse multipart parameters from a request. Adds the
following keys to the request map:
:multipart-params - a map of multipart parameters from the request body.
:params - merges multipart-params into existing :params.
Accepts the following options:
:encoding - Forced character encoding for fields. Overrides part Content-Type.
:fallback-encoding - Encoding used if part has no Content-Type charset. Defaults
to request encoding or UTF-8.
:store - Function to handle file uploads. Takes map with
:filename, :content-type, :stream, :part-headers.
Default is the temp-file-store. For in-memory storage use
the byte-array-store function.
:progress-fn - Function called during uploads with parameters: request,
bytes-read, content-length, item-count.
Throws on parsing errors.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |