This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-07
Channels
- # beginners (7)
- # boot (25)
- # clojure (66)
- # clojure-australia (10)
- # clojure-berlin (1)
- # clojure-czech (1)
- # clojure-denmark (2)
- # clojure-france (27)
- # clojure-italy (6)
- # clojure-japan (1)
- # clojure-nl (5)
- # clojure-norway (1)
- # clojure-russia (25)
- # clojurescript (55)
- # cursive (27)
- # datascript (2)
- # datomic (5)
- # editors (4)
- # emacs (2)
- # hoplon (183)
- # ldnclj (45)
- # off-topic (4)
- # om (2)
- # rdf (5)
- # re-frame (11)
- # reagent (5)
- # ring (3)
question from beginner: I want to serve PDF using compojure, something like GET "/:invoice-no" should invoke download dialog in browser
I found my question here: https://groups.google.com/forum/#!topic/clojure/eXyT7TRjKMA - but the answer is not clear for me
the answer: "You need to set the Content-Disposition header yourself" - how do I set header here?
my current handler: (GET "/:invoice-no" [invoice-no] (http://clojure.java.io/file (str invoice-no ".pdf")))``
You need to pass, as part of the header of the GET response, the content disposition. So for example you could create a wrapper like
oh, I see, going to digg into ring-resp/response structure, thanks!