Fork me on GitHub
#yada
<
2019-10-15
>
borkdude15:10:38

if I want to return a file response, I can just return a file as the return value, but how do I set the name if I want to change it?

borkdude15:10:03

I now did it like this:

(-> resp
                            (assoc :body file)
                            (assoc-in [:headers "Content-Disposition"] "attachment; filename=\"filename.jpg\""))

dominicm15:10:25

That's right.

dominicm15:10:36

Would be cool to have a data description for that kind of thing.

dominicm15:10:06

That would be a pretty neat extension to a content negotiation system, something higher level which could generate headers or cookies.