Object Storage - How to change the object visibility

#1

Hello,
I just started use a object storage.
I configured a private bucket, but i want my files public-read.
How can change the visibility of my objects?

Any clue?

#2

Hi!

If you’re using the aws CLI, you can add the --acl public-read option.

Otherwise, you can edit the visibility of an object from the console:

#3

Hello and thank you @Angristan for your response.

But my problem is about thousands objects :sweat_smile:
This can be done in a batch process?

The origin it was the massive transfer from my server to the bucket using rclone. I’ve tried to change the acl configuration from private to public-read of rclone remote and resent the objects in order to chanche the visibility but didn’t work properly.

any clue?

#4

You cannot technically update an object’s visibility in S3, you have to copy the object to itself with the updated ACL. Like this:

rclone sync scw:bucket scw:bucket --s3-acl=public-read

(I haven’t tested with rclone but it should work. Otherwise aws s3 cp --recursive s3://bucket s3://bucket --acl=public-read)

Don’t worry, it will trigger a server-side copy so it’s gonna be very fast.

#5

Hello,
it seems using rclone is not possible to do it

$ rclone sync scw:bucket/ scw:bucket/ --s3-acl=public-read
2020/04/15 09:08:56 ERROR : Fatal error received - not attempting retries
2020/04/15 09:08:56 Failed to sync: can't sync or move files on overlapping remotes

I will try with aws.

thnks

#6

Oops, sorry. Let me know if you can’t get it to work with the aws cli!

#7

Nice!!! it’s woking!!!

Using the aws cli

aws s3 cp --recursive s3://bucket s3://bucket --acl=public-read

Many thanks @Angristan for your help!!!

1 Like