2

I am using sharp to resize images on AWS Lambda. It works fine for testing but the issue is that how to give dynamic content type according to the content type of image.

My code is

then(buffer => S3.putObject({
    Body: buffer,
    Bucket: dstBucket,
    ContentType: 'image/jpeg',
    Key: dstKey,
  }).promise()
)

I want this contentType is according to buffer content Type.

Ullas Hunka
  • 2,119
  • 1
  • 15
  • 28
Haseeb Ahmad
  • 7,914
  • 12
  • 55
  • 133

0 Answers0