Question
File Upload Read Permissions on DO Spaces
I have been trying out spaces with in my Laravel application’s file uploads feature. While I have successfully uploaded the files from the application using the S3 driver, users cannot view the images uploaded because the images are uploaded with permissions as private in spite of the fact that the bucket itself has public read access. Links to the images return the following error;
<Error>
<Code>AccessDenied</Code>
<BucketName>stevepop</BucketName>
<RequestId>99999-nyc3a</RequestId>
<HostId>aaaaa-nyc</HostId>
</Error>
With Amazon S3, I am able to set the bucket items permission with a policy like the one below;
{
“Version”: “2008-10-17”,
“Statement”: [
{
“Sid”: “AllowPublicRead”,
“Effect”: “Allow”,
“Principal”: {
“AWS”: “”
},
“Action”: “s3:GetObject”,
“Resource”: “arn:aws:s3:::uploads/”
}
]
}
This way, all file uploads are immediately readable by users.
Is there an equivalent way of doing this in Spaces? If I can’t do this then this feature will not be of any use to me.
Thanks!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×