Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1.24 KB

README.md

File metadata and controls

33 lines (23 loc) · 1.24 KB

aws_s3_upload

Added Support of Linode
Now you can pass custom domain (e.g linodeobjects.com) to 'domain' parameter.

A simple, convenient package for uploading to S3.

Heavily inspired by this stackoverflow answer

Getting Started

Having created credentials on AWS, upload a file like so:

AwsS3.uploadFile(
  accessKey: "AKxxxxxxxxxxxxx",
  secretKey: "xxxxxxxxxxxxxxxxxxxxxxxxxx",
  file: File("path_to_file"),
  bucket: "bucket_name",
  region: "us-east-2",
  domain: "linodeobjects.com", // optional - Default: amazonaws.com
  metadata: {"test": "test"} // optional
);

Warning

Before using this package, consider if it's acceptable to include AWS keys in your final app. Doing so might be okay for internal or trusted apps, but think twice before including keys in an app published on the app store.

Motivation / Disclaimer

There already exists a number of Flutter plugins for interacting with S3, some of which are more actively maintained. This small library was built because the few I tried either failed to work out of the box, or required the use of a Pool ID and AWS Cognito, which my project doesn't use. YMMV.