aws_s3_client 0.2.0 copy "aws_s3_client: ^0.2.0" to clipboard
aws_s3_client: ^0.2.0 copied to clipboard

Client library to interact with the AWS S3 API (and other compatible S3 services, as Yandex Cloud Storage)

example/example.dart

import 'dart:io';
import 'package:aws_s3_client/aws_s3_client.dart';

main() async {
  Spaces spaces = Spaces(
    region: "region",
    accessKey: "accessKey",
    secretKey: "secretKey",
  );
  for (String name in await spaces.listAllBuckets()) {
    print('bucket: ${name}');
    if (name == 'yourBucket') {
      Bucket bucket = spaces.bucket(name);
      await for (BucketContent content in bucket.listContent(prefix: 'test')) {
        print('key: ${content.key}; size: ${content.size}');
      }
    }
  }
  Bucket bucket = spaces.bucket('yourBucket');

  File file = File('README.md');

  String etag = await bucket.uploadFile(
      'test/test.md', file.readAsBytesSync(), 'text/plain', Permissions.public);
  print('upload: $etag');

  print('done');
}
7
likes
40
points
43
downloads

Publisher

unverified uploader

Weekly Downloads

Client library to interact with the AWS S3 API (and other compatible S3 services, as Yandex Cloud Storage)

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

crypto, http, http_client, meta, mime, path, xml

More

Packages that depend on aws_s3_client