Upload a file to a different aws s3 bucket in flutter

216 Views Asked by At

In my Flutter app I use Amazon S3 to store my videos and images. I use amplify_flutter package to upload files. After following the official documentation of AWS Amplify, I created a bucket to upload videos and this bucket is refrenced in amplifyconfiguration.dart file. As the documentation states, I am using the following code for file upload:

 Amplify.Storage.uploadFile(
    local: file,
    key: key,
    onProgress: (TransferProgress progress) {},
);

This code will always upload the file to one specific bucket that is configured in the amplifyconfiguration.dart file. However, I want to create another bucket for example only for photos. The problem is, first how to create it, and second how to reference it in the time of uploading the file. Thanks in advance.

0

There are 0 best solutions below