Each file I upload to my space is in private mode, how to make every file I upload to public. my space is public but when i call files ACCESS DENIED
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
How to make the object public after its uploaded to space using api in python? I am using below code snippet to upload file:
session1 = session.Session()
client = session1.client('s3',
region_name='ams',
endpoint_url='https://ams3.digitaloceanspaces.com',
aws_access_key_id=do_access_key,
aws_secret_access_key=do_secret_key)
client.upload_file(file_name, 'xxxxxxx', key)
i know its been a really long time
but you can do this
client.upload_file(file_name, 'Bucket', 'object_name')
client.put_object_acl( ACL='public-read', Bucket='Bucket', Key='object_name') #keep the variables change only the values
File permissions are independent of Space permissions at the moment. (Sorry, I know this is a bit confusing and we hope to be able to make this part of permissioning more intuitive in a future release.)
You will need to change all of your files to have the ‘Public’ permission if you’d like them to be world readable, regardless of how you’ve set your Space permission.
For Space permissions, ‘Private’ means that the objects in the Space can’t be listed by non-authenticated (those without a valid Space key for the account) users. ‘Public’ means that those files can be listed by anyone, regardless of whether or not they have a valid Spaces key for the account.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.