From b6d357e3608d9ad57e9cf0b5fcb808fe2b47ef1e Mon Sep 17 00:00:00 2001 From: AllanZhengYP Date: Wed, 29 Jun 2022 10:18:08 -0700 Subject: [PATCH] fix large file, mulitipart upload to s3 (#4141) * fix large file, mulitipart upload to s3 * add changelog Co-authored-by: Emile Indik --- .changes/next-release/bugfix-ManagedUpload-91473b2e.json | 5 +++++ lib/s3/managed_upload.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/next-release/bugfix-ManagedUpload-91473b2e.json diff --git a/.changes/next-release/bugfix-ManagedUpload-91473b2e.json b/.changes/next-release/bugfix-ManagedUpload-91473b2e.json new file mode 100644 index 0000000000..b18ef17a5b --- /dev/null +++ b/.changes/next-release/bugfix-ManagedUpload-91473b2e.json @@ -0,0 +1,5 @@ +{ + "type": "bugfix", + "category": "ManagedUpload", + "description": "fix MalformedXML error for relatively large file via managed upload" +} \ No newline at end of file diff --git a/lib/s3/managed_upload.js b/lib/s3/managed_upload.js index ea326330b0..ecd98016a5 100644 --- a/lib/s3/managed_upload.js +++ b/lib/s3/managed_upload.js @@ -574,7 +574,7 @@ AWS.S3.ManagedUpload = AWS.util.inherit({ if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) return null; partInfo.ETag = data.ETag; self.doneParts++; - if (self.isDoneChunking && self.doneParts === self.numParts) { + if (self.isDoneChunking && self.doneParts === self.totalPartNumbers) { self.finishMultiPart(); } else { self.fillQueue.call(self);