javascript v3 sdk s3.GetObjectCommand download stream

0

In the new v3 javascript sdk, how does streaming download of an s3 object work? I used to use getObject(params).createReadStream().pipe(out), but createReadStream is not defined here:
s3.send(new GetObjectCommand(params)).createReadStream();

已提問 3 年前檢視次數 10018 次
1 個回答
0

This answers it:
https://github.com/aws/aws-sdk-js-v3/issues/1096

the returned property, Body, is a streamable, so response.Body.pipe(createWriteStream(fileName));

已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南