简体   繁体   中英

How to upload a photo from an iOS device to AWS S3 in Flutter application?

I have been trying to upload images in Flutter application to AWS S3 .

I used this plugin: amazon_s3_cognito , it worked correctly with Android device using this method:

String uploadedImageUrl = await AmazonS3Cognito.upload(
            _image.path,
            BUCKET_NAME,
            IDENTITY_POOL_ID,
            IMAGE_NAME,
            AwsRegion.US_EAST_1,
            AwsRegion.AP_SOUTHEAST_1);

But, when I run the same project on iOS device, the upload method returned with an empty String !

I tried to edit the source code of the plugin but I got stuck.

Please suggest a solution using this plugin or any solution to upload the image and get its link.

This is a known issue with the plugin, it only works for public buckets for now

https://github.com/prachiFam/amazon_s3_cognito/issues/5

I found this tutorial that is helpfull on how to implement

Upload & fetch media files from AWS S3 in Flutter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM