Liking cljdoc? Tell your friends :D

ring-multipart-nodeps.core


default-byte-array-storeclj

(default-byte-array-store {:keys [filename content-type stream] :as file-info})

Stores uploaded files in memory as byte arrays

Stores uploaded files in memory as byte arrays
sourceraw docstring

multipart-form?clj

(multipart-form? request)

Returns true if the request is a multipart form request

Returns true if the request is a multipart form request
sourceraw docstring

multipart-params-requestclj

(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 default-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 default-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.
sourceraw docstring

temp-file-storeclj

(temp-file-store {:keys [filename content-type stream] :as file-info})

Stores uploaded files to temporary files on disk. Never loads the entire file into memory.

Stores uploaded files to temporary files on disk.
Never loads the entire file into memory.
sourceraw docstring

wrap-multipart-paramsclj

(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 default-byte-array-store function. :progress-fn - Function called during uploads with parameters: request, bytes-read, content-length, item-count.

Does simple error handling; throws exceptions 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 default-byte-array-store function.
:progress-fn       - Function called during uploads with parameters: request,
                     bytes-read, content-length, item-count.

Does simple error handling; throws exceptions on parsing errors.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close