Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix: only multipart when count is greater than 1

Prateek Sunal2b9db5cbfbcf
diff --git a/mobile/lib/utils/file_uploader.dart b/mobile/lib/utils/file_uploader.dart
index df3e54aeca..c60ef3e861 100644
--- a/mobile/lib/utils/file_uploader.dart
+++ b/mobile/lib/utils/file_uploader.dart
@@ -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,