getUploadMetadata method

dynamic getUploadMetadata(
  1. String cloudPath
)

获取上传文件自定义属性

Implementation

getUploadMetadata(String cloudPath) async {
  _checkParams(cloudPath, 'cloudPath is required');

  String action = 'storage.getUploadMetadata';

  CloudBaseResponse res = await _request.post(action, {'path': cloudPath});

  // 存在 code,说明返回值存在异常
  if (res.code != null) {
    throw new CloudBaseException(code: res.code, message: res.message);
  }

  UploadMetadata metadata = UploadMetadata.fromMap(res.data);
  CloudBaseStorageRes<UploadMetadata> storageRes =
      CloudBaseStorageRes(requestId: res.requestId!, data: metadata);

  return storageRes;
}