Fork me on GitHub
#aws
<
2021-01-19
>
zendevil07:01:29

I’m using amazonica to upload a file to a bucket like so:

zendevil07:01:40

(s3/put-object “humboi-videos” “video1.mp4" “./resources/public/sample.mp4”)

zendevil07:01:53

The objects that are created are not publicly readable, and I want them to be publicly readable. How to do this? Secondly, how to programmatically access the object uri?

lukasz15:01:23

You need to pass :access-control-list {:grant-permission ["AllUsers" "Read"] to put-object

lukasz15:01:56

@ps The URIs... as far as I remember , the public ones you have to construct yourself - the follow the same pattern as described here: https://docs.aws.amazon.com/general/latest/gr/s3.html For pre-signed, limited access urls (which are usually better solution than making objects public) you have to use the S3 SDK directly by using the GeneratePresignedUrlRequest class