This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-06
Channels
- # announcements (18)
- # asami (14)
- # aws (5)
- # babashka (58)
- # beginners (32)
- # calva (12)
- # cider (29)
- # clj-kondo (8)
- # cljfx (8)
- # cljs-dev (4)
- # clojure (101)
- # clojure-europe (54)
- # clojure-germany (5)
- # clojure-nl (8)
- # clojure-serbia (8)
- # clojure-spec (12)
- # clojure-uk (8)
- # clojurescript (24)
- # cursive (3)
- # datomic (17)
- # docs (2)
- # etaoin (12)
- # events (1)
- # fulcro (1)
- # google-cloud (2)
- # jobs (1)
- # jobs-discuss (6)
- # lsp (65)
- # luminus (2)
- # malli (10)
- # meander (4)
- # nrepl (1)
- # off-topic (112)
- # onyx (2)
- # pathom (6)
- # polylith (14)
- # re-frame (9)
- # reagent (36)
- # reitit (13)
- # releases (2)
- # remote-jobs (5)
- # rewrite-clj (12)
- # shadow-cljs (70)
- # specter (2)
- # startup-in-a-month (1)
- # xtdb (14)
Hi. I’m using the aws-api to upload a file to S3, and I want to set the Content-Type. I converted a java example I found to roughly this code:
(let [md {"content-type" "text/plain"}
response (core/throw-on-error
(aws/invoke client
{:op :PutObject
:request {:Bucket ""
:Key "marc/foo2.txt"
:Body (-> "some text" (.getBytes "UTF-8") (ByteArrayInputStream.))
:Metadata md}}))]
(:Body response))
But this is not working. When I check out the newly uploaded file in Amazon, I see:
• System defined, Content-Type , application/octet-stream
• User defined, x-amz-meta-content-type, text/plain
So, instead of setting the system defined “Content-Type”, it stuffed my value into x-amz-meta-content-type
.
Any suggestions?