Skip to content
All articles
Engineering· 2 min read

How direct-to-S3 uploads work in Ceruly

A look under the hood at how Ceruly uploads files up to 5 GB straight from your browser to Amazon S3, without routing them through our servers.

Ceruly engineering

When you drop a 2 GB video into Ceruly, it doesn't travel through our application servers. It goes straight from your browser to Amazon S3. This post explains how that works and why it matters.

Why not upload through the server?

The simple way to build file uploads is to send the file to your own server, which then forwards it to storage. That has real costs:

  • It's slower. Every byte crosses the network twice.
  • It's fragile. Serverless functions have short time limits and small request bodies, which rules out large files.
  • It's expensive. You pay for compute time while bytes trickle through.

Ceruly avoids all three by letting your browser talk to S3 directly, with permission granted one file at a time.

The three steps

1. Ask for permission

Your browser tells Ceruly the file's name, size and type. Ceruly checks that you're signed in, that uploads are allowed, and that the file fits within the size limit. It then reserves the space in your quota in a single atomic database update, so two uploads at once can never take you over your limit.

2. Upload with a signed URL

Ceruly creates a presigned URL for exactly one object. The signature covers the destination, the content type and the exact content length, and the URL expires after an hour. Your browser sends the file to that URL with a standard HTTP PUT, reporting progress as it goes.

Up to three files upload in parallel. The rest wait in a queue, so a folder of 200 photos doesn't saturate your connection.

3. Confirm

When the upload finishes, your browser tells Ceruly. Ceruly asks S3 for the object's metadata and checks that the size matches what you declared. Only then does the file appear in your drive. If you cancel, or the upload never completes, the reserved space is released and the partial object is cleaned up.

What this means for you

  • Uploads run at the full speed of your connection.
  • Files up to 5 GB work, the most a single S3 PUT allows.
  • Your quota is always accurate, even with many uploads in flight.

Ready to try it? Upload your first file, or read the uploading files guide.

Try Ceruly for free

5 GB of secure storage. No credit card required.

Get started