Closed zhangzhe532 closed 1 year ago
version: 6.2.0
Example:
final bytes = "file bytes".codeUnits;
final response = await Client().putObject(
bytes,
"test.txt",
option: PutRequestOption(
onSendProgress: (count, total) {
print("send: count = $count, and total = $total");
},
onReceiveProgress: (count, total) {
print("receive: count = $count, and total = $total");
},
override: false,
aclModel: AclMode.publicRead,
storageType: StorageType.ia,
headers: {"cache-control": "no-cache"},
callback: Callback(
callbackUrl: "callback url",
callbackBody: "{\"mimeType\":\${mimeType}, \"filepath\":\${object},\"size\":\${size},\"bucket\":\${bucket},\"phone\":\${x:phone}}",
callbackVar: {"x:phone": "android"},
calbackBodyType: CalbackBodyType.json,
),
),
);
可以从response中获取回调的返回结果以及数据
OSS 上传回调