ring

petr.mensik 2018-06-19T16:03:02.001032Z

How to correctly return a file for download in Ring? I am returning this response however the file in there is a mess (but it's not empty either)

{:status 200
       :headers {"Content-Type" "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                 "Content-Disposition" "attachment; filename=listing_offer.xlsx"}
       :body (io/input-stream "/tmp/sheet.xlsx")
File in the /tmp is ok and can be opened normally. Thanks for advice!

seancorfield 2018-06-19T17:34:07.000470Z

@petr.mensik Have you tried using http://ring-clojure.github.io/ring/ring.util.response.html#var-file-response instead of constructing the response yourself?