s3: in v3, Body is a stream
https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/migrate-s3.html
This commit is contained in:
@@ -199,10 +199,11 @@ class S3MultipartDownloadStream extends Readable {
|
||||
if (error) return this._handleError(error);
|
||||
|
||||
const contentLength = parseInt(data.ContentLength, 10); // should be same as length
|
||||
const body = await data.Body.transformToString();
|
||||
|
||||
if (contentLength > 0) {
|
||||
this._readSize += contentLength;
|
||||
this.push(data.Body);
|
||||
this.push(body);
|
||||
} else {
|
||||
this._done();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user