Let’s get on the same page

In my previous post, Working with S3 pre-signed URLs, I showed you how and why I used pre-signed URLs.

This time I faced another problem: I had to upload a large file to S3 using pre-signed URLs. To be able to do so I had to use multipart upload, which is basically uploading a single object as a set of parts, with the advantage of parallel uploading.

In the following article, I’ll describe how I combined and used multipart upload with pre-signed URLs.

A normal multipart upload looks like this:

  1. Initiate a multipart upload
  2. Upload the object’s parts
  3. Complete multipart upload

For that to work with pre-signed URLs, we should add one more stage: generating pre-signed URLs for each part.

The final process looks like this:

  1. Initiate a multipart upload
  2. Create pre-signed URLs for each part
  3. Upload the object’s parts
  4. Complete multipart upload

Stages 1,2, and 4 are server-side stages, which require an AWS access key id & secret, where stage number 3 is client-side.

Let’s explore each stage.

#nodejs #aws #aws-s3 #serverless #presigned-url

Multipart uploads with S3 pre-signed URLs
51.90 GEEK