Created
May 29, 2017 15:47
-
-
Save malcolmsparks/e30b0338c054c29cfda730a4b597aa1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(resource | |
{:id ::index | |
:methods | |
{:post | |
{:consumes "application/octet-stream" | |
:consumer (fn [ctx _ body-stream] | |
(let [f (java.io.File/createTempFile "yada" ".tmp" (io/file "/tmp"))] | |
(infof "Saving to file: %s" f) | |
(save-to-file | |
ctx body-stream | |
f))) | |
:response (fn [ctx] (format "Thank you, saved upload content to file: %s\n" (:file ctx)))}}}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment