fluent_qcloud_cos 0.2.2 copy "fluent_qcloud_cos: ^0.2.2" to clipboard
fluent_qcloud_cos: ^0.2.2 copied to clipboard

Tencent Cloud Object Storage Upload Plugin, supports fast upload and progress display 腾讯云对象存储上传插件, 支持分快上传, 进度显示.

fluent_qcloud_cos #

Pub Version (including pre-releases) GitHub license GitHub stars

一个纯dart实现的腾讯云对象存储的包.

Features #

  • 简单文件上传
  • 分快上传(断点续传).

Usage #

final handler =
        ObjectStoragePutObjectEventHandler(taskId: "putObjectSimple");
    handler.onFailed = (event) {
      cosLog(event.errorMessage ?? "未知错误");
    };
    handler.onSuccess = (event) {
      cosLog("上传成功");
    };
    handler.onProgress = (event) {
      cosLog("${event.currentSize}/${event.totalSize}");
    };
/// 如果要异步上传请勿使用 await 关键字, 并传入 handler 以获取进度和错误
FluentQCloudCos.putObject(
      ObjectStoragePutObjectRequest(
        taskId: "putObjectFileSizeMoreThan20M",
        filePath: largeFilePath,
        bucketName: bucketName!,
        objectName: "file-small.jpg",
        accessKeyId: secretId!,
        accessKeySecret: secretKey!,
        securityToken: "",
        expiredTime:
            DateTime.now().add(const Duration(days: 50)).millisecondsSinceEpoch,
        region: region!,
      ),
      handler: handler,
    );
0
likes
120
points
71
downloads

Publisher

verified publisherjiejie.dev

Weekly Downloads

Tencent Cloud Object Storage Upload Plugin, supports fast upload and progress display 腾讯云对象存储上传插件, 支持分快上传, 进度显示.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

async, convert, crypto, dio, fluent_object_storage, flutter, mime, platform_file, sync, xml

More

Packages that depend on fluent_qcloud_cos