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
raw 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
raw 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 - Optional function called with (bytes-read is-file?) for tracking upload progress.

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       - Optional function called with (bytes-read is-file?) for tracking upload progress.
raw 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.
raw 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 options map (see multipart-params-request). 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 options map (see `multipart-params-request`). Does simple error
handling; throws exceptions on parsing errors.
raw docstring

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

× close