1

I am trying to list all the items inside an S3 storage bucket. I have made my bucket public and my storage type is also set to guest but still when I run the Amplify.Storage.list() method it throws an access denied error (403)

Here's the code:

Future<void> listItems() async {
try {
 final ListResult result = await Amplify.Storage.list();
 final List<StorageItem> items = result.items;
 print('Got items: $items');
 } on StorageException catch (e) {
print('Error listing items: $e');
 }
}

What am I missing?

James Z
  • 12,209
  • 10
  • 24
  • 44
Suyash_singh
  • 43
  • 2
  • 5

0 Answers0