How to set ACL to "public-read" on an S3 object via HTTP



I have a pretty common scenario where my website is generating some images and then uploading to S3 via MinioNET Core client. The images have nothing sensitive on them and must be publicly accessible.

In order to serve those images the only way I could find is to get them via MinioNET Core, save as memory stream and pass it via my webserver. This is very inefficient since I would rather just pass the S3 URL directly.

The problem is that is not possible because all the files I upload are private by default and I have to set-up ACL to “public-read” somehow. I have no idea how tho because all the tutorials are using command-line tools but I need my program to do it so I wonder how can I do it via HTTP.

I have found this PUT endpoint but I have to say it doesn’t say anything much. Can someone please share a better example?

For example:

  • What is the actual hostname for these API calls?
  • Which authorization parameters should I pass and where?

The Minio SDKs don’t support object ACLs. You have to use a AWS SDK.