Skip to content

How to feed a pack Stream to AWS S3 SDK v3? #176

@ngervasi-cosa

Description

@ngervasi-cosa

Hi,
I'm trying to stream a tar directly to AWS S3 using SDK v.3 like this:

`const readable = tar.pack("${path}/${dirName}");

const pipeline = readable

    .pipe(createGzip())

    .pipe(await uploadStream(readable, s3KeyName,config.attachmentsStorageClass));`

But unfortunately the SDK is checking the stream using instanceof and returns this error:

"Body Data is unsupported format, expected data to be one of: string | Uint8Array | Buffer | Readable | ReadableStream | Blob;.".

tar.pack returns a Pack object, is there any way to convert it to ReadableStream?

It used to work fine in SDK v.2 but with v.3 is broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions