A simple helper for uploading files to AWS S3. It returns the download URL if the upload is successful, OR null if it failed.
Getting started
No special configuration are required for this package.
Usage
Get your AWS credentials: accessKey, secretKey, region, and S3 bucket name.
A typical usage example is shown below:
final result = await AwsS3Helper().uploadFile(
file: fileToUpload,
s3BucketName: "s3BucketName",
s3Region: "s3Region",
accessKey: "accessKey",
secretKey: "secretKey",
directory: "directory", //(Optional)
);
if (result != null) {
print('File Uploaded successfully! URL: $result');
return result;
} else {
return null;
}
Note
This simple package was created as an alternative to existing packages that are either unstable or lacking maintenance.