File Uploads

weavejester edited this page Oct 29, 2011 · 1 revision

Uploading a file to a website requires multipart form handling, which Ring provides with its wrap-multipart-params middleware.

(use 'ring.middleware.params
     'ring.middleware.multipart-params)

(def app
  (-> your-handler
      wrap-params
      wrap-multipart-params))

By default, uploads are stored in temporary files that are deleted an hour after being uploaded.