- Newest
- Most votes
- Most comments
Thanks for your question.
It seems like you are using the Amplify Flutter library to upload a file to an S3 bucket and trying to make it publicly accessible. The code you provided specifies the access level as StorageAccessLevel.guest and sets the ACL (Access Control List) metadata to 'public-read', which should theoretically make the uploaded object publicly accessible.
To make the object publicly accessible, you need to set the ACL to "public-read" at the time of object creation or after the object is created. You can try the following code to update the ACL of the uploaded object to "public-read":
final response = await Amplify.Storage.updateObjectACL({ bucketName: '', key: '', acl: 'public-read' });
However, there are a few considerations to ensure that the object is indeed publicly accessible:
Double-check the S3 bucket policy to make sure it allows public access. You can configure a bucket policy that allows public access to objects.
Ensure that the CORS (Cross-Origin Resource Sharing) configuration of your S3 bucket allows requests from any origin (or from your app's origin).
You can take a look at the official documentation for some examples.
You can also check how to set the file access level here.
Relevant content
- asked a year ago
- asked 2 years ago
- asked 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago