fix: only multipart when count is greater than 1
This commit is contained in:
parent
baeac73339
commit
2b9db5cbfb
1 changed files with 8 additions and 5 deletions
|
@ -497,13 +497,16 @@ class FileUploader {
|
|||
await encryptedFile.length(),
|
||||
);
|
||||
|
||||
final fileUploadURLs = await getMultipartUploadURLs(count);
|
||||
final fileObjectKey = fileUploadURLs.objectKey;
|
||||
String fileObjectKey;
|
||||
|
||||
await putMultipartFile(fileUploadURLs, encryptedFile);
|
||||
if (count <= 1) {
|
||||
final fileUploadURL = await _getUploadURL();
|
||||
fileObjectKey = await _putFile(fileUploadURL, encryptedFile);
|
||||
} else {
|
||||
final fileUploadURLs = await getMultipartUploadURLs(count);
|
||||
fileObjectKey = await putMultipartFile(fileUploadURLs, encryptedFile);
|
||||
}
|
||||
|
||||
// final fileUploadURL = await _getUploadURL();
|
||||
// fileObjectKey = await _putFile(fileUploadURL, encryptedFile);
|
||||
final metadata = await file.getMetadataForUpload(mediaUploadData);
|
||||
final encryptedMetadataResult = await CryptoUtil.encryptChaCha(
|
||||
utf8.encode(jsonEncode(metadata)) as Uint8List,
|
||||
|
|
Loading…
Add table
Reference in a new issue