Upload file to S3 using Lambda, the pre-signed URL way

Vihaan
3 min readMar 1, 2020
Zoho — Bucket like building

Jobobo, my recent side project, is a Japan tech job board for foreigners. It is a WIP. In Jobobo, Job seekers will be able to upload their resumes to the jobs they wish to apply. I always prefer Serverless. So I want to find a way to upload files to S3 through Lambda.

Initially was trying to upload the binary file (resume) to Lambda. Then once the file hits the Lambda, I was planning to upload it to S3 and ingest the metadata of the resume in Dynamo DB. But I couldn’t get it working; I came across some blogs suggesting to change few configurations in API Gateway to get the binary upload working. None worked for me. The conventional way is to use the pre-signed URL to upload files to S3.

WTF is a pre-signed URL?

All objects and S3 buckets, by default, are private. The pre-signed URLs are useful if you want your user/customer to be able to upload a specific object to your bucket, but you don’t require them to have AWS security credentials or permissions.

High-Level Workflow

High-level workflow to upload file to S3 using pre-signed URL

Step 1: Getting the pre-signed URL

--

--