Report this

What is the reason for this report?

How to set permission of all files in a bucket as public on every upload.

Posted on November 7, 2017

I am accessing DigitalOcean Spaces with the help of AWS SDK. I am able to connect and upload file to the Spaces bucket. I’m uploading a directory with recursive directories and files using ‘TransferManager.uploadDirectory()’ method. Is there a way to set permission as public as a part of uploading instead of iterating and setting individual object permission in another API call. But I want to set permission of all files which I’m uploading as ‘public’. By default it is ‘private’.

I tried using AWS bucket policy … but it is not supporting in DO Spaces. Also everytime I upload files to that particular bucket, I want all those files to be public.

Kindly help me with this. I’m searching for a generic solution. I’m not getting any way around.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.