How to Fix DigitalOcean Spaces Access Denied for New Files Uploaded
Digital Ocean’s (DO) Spaces is a Amazon S3 alike storage space that allows you to store and serve files. By default, permission of files uploaded to your Space buckets will be set as Private.
If you are trying to access these files (be it .txt, .jpg, .png, .pdf, etc) publically via browser, you will be redirected to an error page that looks something like the following:
We encounter the same problem while uploading files via Transmit to our Spaces bucket.
The good news is, it can be solved quite easily with adding the Amazon S3 Access Control List (ACL) request header,
x-amz-acl. This header will mark every files uploaded to the bucket as publicly readable.
We can add this header to Transmit so it will send any files with the header. Once done, the files will appear with Permission: Public in the Digital Ocean dashboard.
Here’s how you can add the header:
- Launch Transmit, go to Preferences.
- Click Cloud Tab.
- Under the Extension column, select Default.
- Click the + sign with dropdown, select
x-amz-aclfor Name, and
If you’re currently connected to DO Space bucket via Transmit, you might need to disconnect and connect it again. From now on, files uploaded to your Spaces bucket via Transmit will by default be public and accessible via browser.