prachiFam / amazon_s3_cognito

this is a Flutter plugin allows users to upload and delete image for amazon s3 cognito
Other
16 stars 24 forks source link

Image uploading not working #26

Open udaysagartammina opened 3 years ago

udaysagartammina commented 3 years ago

Error - reason: 'Invalid region type.' bucketSubRegion ---> where I am getting this value?

Code : String bucketName = "app-test-attachments"; String cognitoPoolId = "us-east-1_hXdyKXxXn"; String bucketRegion = "us-east-1"; String bucketSubRegion = "";

//fileUploadFolder - this is optional parameter
String fileUploadFolder =
    "public";

String filePath = imageFile.toString(); //path of file you want to upload
ImageData imageData = ImageData("uniqueFileName", filePath,
    uniqueId: "uniqueIdToTrackImage", imageUploadFolder: fileUploadFolder);

//result is either amazon s3 url or failure reason
String? result = await AmazonS3Cognito.upload(
    bucketName, cognitoPoolId, bucketRegion, bucketSubRegion, imageData,
    needMultipartUpload: true);
//once upload is success or failure update the ui accordingly
print(result);

could you please help me with anyone?
thanks in advance.