Liking cljdoc? Tell your friends :D

ring.middleware.multipart-params

Middleware that parses multipart request bodies into parameters.

This middleware is necessary to handle file uploads from web browsers.

Ring comes with two different multipart storage engines included:

ring.middleware.multipart-params.byte-array/byte-array-store ring.middleware.multipart-params.temp-file/temp-file-store

Middleware that parses multipart request bodies into parameters.

This middleware is necessary to handle file uploads from web browsers.

Ring comes with two different multipart storage engines included:

  ring.middleware.multipart-params.byte-array/byte-array-store
  ring.middleware.multipart-params.temp-file/temp-file-store
raw docstring

multipart-params-requestclj

(multipart-params-request request)
(multipart-params-request request options)

Adds :multipart-params and :params keys to request. See: wrap-multipart-params.

Adds :multipart-params and :params keys to request.
See: wrap-multipart-params.
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 :params - a merged map of all types of parameter

The following options are accepted

:encoding - character encoding to use for multipart parsing. If not specified, uses the request character encoding, or "UTF-8" if no request character encoding is set.

:store - a function that stores a file upload. The function should expect a map with :filename, content-type and :stream keys, and its return value will be used as the value for the parameter in the multipart parameter map. The default storage function is the temp-file-store.

:progress-fn - a function that gets called during uploads. The function should expect four parameters: request, bytes-read, content-length, and item-count.

Middleware to parse multipart parameters from a request. Adds the
following keys to the request map:

:multipart-params - a map of multipart parameters
:params           - a merged map of all types of parameter

The following options are accepted

:encoding    - character encoding to use for multipart parsing. If not
               specified, uses the request character encoding, or "UTF-8"
               if no request character encoding is set.

:store       - a function that stores a file upload. The function should
               expect a map with :filename, content-type and :stream keys,
               and its return value will be used as the value for the
               parameter in the multipart parameter map. The default storage
               function is the temp-file-store.

: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

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

× close