This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-13
Channels
- # arachne (2)
- # architecture (23)
- # bangalore-clj (5)
- # beginners (35)
- # boot (79)
- # cider (6)
- # cljs-dev (34)
- # cljsrn (9)
- # clojure (164)
- # clojure-argentina (2)
- # clojure-austin (4)
- # clojure-italy (7)
- # clojure-russia (40)
- # clojure-serbia (1)
- # clojure-spec (76)
- # clojure-uk (36)
- # clojurescript (47)
- # cursive (14)
- # datascript (2)
- # datomic (8)
- # dirac (19)
- # emacs (29)
- # heroku (7)
- # hoplon (35)
- # jobs-rus (1)
- # juxt (2)
- # leiningen (1)
- # lumo (23)
- # mount (4)
- # off-topic (22)
- # om (16)
- # onyx (19)
- # parinfer (10)
- # pedestal (47)
- # proton (5)
- # re-frame (88)
- # rum (1)
- # spacemacs (33)
- # sql (29)
- # uncomplicate (1)
- # unrepl (131)
- # untangled (5)
- # yada (12)
Hey all,
I'm trying to upload an image as multipart/form-data
.
Following the manual (https://juxt.pro/yada/manual/index.html#capturing-large-request-bodies)
I'd like to coerce the the image as java.io.File
in the :parameters
map.
I get the the following error when trying to coerce the file
param as java.io.File
:
manifold.deferred.ErrorDeferred cannot be cast to clojure.lang.Associative
I'm using the following libs:
[yada "1.2.1"]
[prismatic/schema "1.1.3"]
[yada "1.2.1" :exclusions [aleph manifold ring-swagger prismatic/schema]]
[aleph "0.4.2-alpha8"]
[manifold "0.1.6-alpha1"]
and the this yada/resource code to handle the file upload:
(yada/resource
{:consumes "multipart/form-data"
:produces "application/json"
:methods {:post {:parameters {:form {:file java.io.File}}
:response (fn [ctx]
(let [params (get-in ctx [:parameters :form])
file (:file params)]
(println "store file ...")
{:upload true}))}}})
The phonebook example uses multipart/formdata to update a user
Thx @malcolmsparks I've looked at this example already
unfortunately anything else then String
in the :parameters
map (like Long
or java.io.File
) cause the error manifold.deferred.ErrorDeferred cannot be cast to clojure.lang.Associative
any idea why?
Yes. Just configure aleph options @fabrao