Fork me on GitHub
#ring
<
2018-06-25
>
sova-soars-the-sora16:06:35

Hi, i'm wondering about uploading files via html form and /post...

sova-soars-the-sora16:06:20

I'm not really sure how it's supposed to work. does an upload action put a file at a :tempfile "/path/" that I can then reference with java.io.copy to store locally?

jumar07:06:03

We use sth. like this:

(mp/wrap-multipart-params
         (POST "/teams/import" {{{tempfile :tempfile filename :filename} :importteamsfile} :params :as params}
           (friend/authorize #{roles/project-configuration} (import-developer-teams project-id tempfile filename))))
mp is ring.middleware.multipart-params

sova-soars-the-sora16:06:34

i keep getting null pointer exceptions it's difficult to debug.

sova-soars-the-sora17:06:03

is there a reason {:enctype "multipart/formdata"} doesn't want to play nicely?