Replies: 1 comment
-
Hi @tedyu - I noticed you also opened a similar issue in the aws-sdk-js repository and the issue you're facing is related to the way you're trying to consume the response stream from the S3 object. To resolve this, you need to consume the response stream correctly. Here's code example we have in our docs. import { S3 } from "@aws-sdk/client-s3";
const client = new S3({});
const getObjectResult = await client.getObject({
Bucket: "...",
Key: "...",
});
// env-specific stream with added mixin methods.
const bodyStream = getObjectResult.Body;
// one-time transform.
const bodyAsString = await bodyStream.transformToString();
// throws an error on 2nd call, stream cannot be rewound.
const __error__ = await bodyStream.transformToString(); Hope it helps, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We face the following exception using sdk v2 to read data from s3:
Here is related code:
consumers.text is where the exception comes.
If the writer to s3 uses sdk v3, I assume the interaction between v3 writer and v2 reader should work.
v3 ver: 3.50.0
v2 ver: 2.1341.0
Has anyone faced similar exception ?
Beta Was this translation helpful? Give feedback.
All reactions