I have a few files uploaded to my spaces droplet (if that is the correct terminology). When I attempt to access a .jpg image from my website, the console throws a (403) Forbidden error when trying to access it.
Thanks to everyone in advance.
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!
In my case, I integrated the S3 API with a Laravel application. And then used Laravel Media Library to upload (PUT) and view (GET) images on the site… Even though uploading was okay, I was getting 403 forbidden requests for viewing those files!
And thanks to the support, they pointed out that you can view the individual file’s permission within the Space storage in DigitalOcean, and then it hit me! The files were uploaded without the necessary x-amz-acl header that is set to public-read and it was defaulted to private!-_-’
https://developers.digitalocean.com/documentation/spaces/#object
Anyhow, thanks to the amazing Laravel Media Library package, its configuration included an array for extra headers to be attached to the PUT HTTP requests.
Spaces is DO’s Object Storage solution as opposed to Droplet’s which is a compute platform :-)
Usually files uploaded to Spaces are private by default. You can chance the setting at a file level for every file you upload. Can you please make sure your files are not uploaded with the default “private” setting? If it is, please switch this to public. You can do this from our cloud portal or via our API.
Spaces have the following request rate limits:
750 requests (any operation) per IP address per second to all Spaces on an account.
240 total operations per second to any individual Space.
150 combined PUT, POST, COPY, DELETE, and LIST operations per second to any individual Space. We may further limit LIST operations if necessary under periods of high load.
5 PUT or COPY requests per 5 minutes to any individual object in a Space.
Can you verify if you are hitting any of those limits by any chance?
For more information on the limits, you could check out the documentation here:
https://docs.digitalocean.com/products/spaces/details/limits
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.