Node.js aws s3 sdk v3 showing error while putting object

Viewed 92

I am uploading file to s3 from node.js graphql api using graphql-upload,

                const { createReadStream, mimetype, filename } = file;
                const fileStream = createReadStream();
                const prefix = encodeURIComponent(folder) + '/';
                const uploadParam = {
                    Bucket: bucket,
                    Key: `testing`,
                    Body: fileStream,
                    ContentType: mimetype,
                };
                await s3.send(new PutObjectCommand(uploadParam));

Every time I upload, it show this error

  NotImplemented: A header you provided implies functionality that is not implemented
  Code: 'NotImplemented',
  Header: 'Transfer-Encoding',

What am I doing wrong?

0 Answers
Related