Upload object to S3 using Multipart upload method with AWS-SDK V3 for Javascript / Typescript

import { S3Client } from '@aws-sdk/client-s3'
import { Upload } from '@aws-sdk/lib-storage'
​
const buffer = fs.readFileSync('path-to-file.jpg')
const multipartUpload = new Upload({
  client: new S3Client({}),
  params: { Bucket: bucket, Key: key, Body: buffer },
})
​
await multipartUpload.done();
10 lines of code, 298 characters

Similar AWS code snippets using javascript

Finally, a good search for AWS Console

Was that in us-east-1? Or us-west-2? No need to remember. Just type the name of the resource and CloudTempo will find it.

Feature