Architecture diagram contrasting direct browser multipart uploads to S3 using Uppy and presigned URLs against server proxying bottlenecks

Uploading a 500 MB video or a 5 GB raw dataset through your web application backend is an architectural trap.

Every megabyte sent by the client enters your application server first, occupies heap memory or temporary disk space, and then gets re-transmitted over a second connection to object storage. When twenty users upload simultaneously, your app server runs out of file descriptors, worker threads stall, and cloud bandwidth bills double.

The solution is direct client-to-bucket multipart uploads. The browser slices files into 10 MB or 20 MB chunks and streams each chunk straight to the S3 bucket via presigned URLs. Your backend server never touches the raw payload—it only signs authorization tokens.

Server proxy vs direct browser multipart: measured impact

Here is what happens on a typical 4-core, 8 GB RAM application server ingesting 1,000 files of 500 MB each (500 GB total upload volume):

MetricServer-proxied uploadDirect S3 multipart (Uppy)Difference / Benefit
Server transit bandwidth500 GB in + 500 GB out (1.0 TB)0 GB (only metadata API)100% elimination of transit bandwidth
App server RAM per active stream150 MB – 850 MB buffer4 MB (lightweight JSON token handler)99.5% reduction in worker memory footprint
Peak CPU usage during uploads78% – 94% (context switching & TLS)3% – 5% (HMAC SigV4 signing only)Leaves app server available for API requests
Upload timeout riskHigh (proxy gateway 60s/120s limit)Zero (each chunk uploads in 2–5s)Eliminates reverse proxy 504 Gateway Timeouts
Resilience to network dropRestart entire 500 MB uploadRetry failed 10 MB chunk onlyResumable uploads across network blips
Max upload size support500 MB (practical proxy ceiling)Up to 5 TB (S3 multipart limit)Handles massive media and raw archives

S3 bucket CORS configuration

Because the browser makes direct cross-origin HTTP requests to your S3 endpoint, you must configure CORS on the target bucket. Specifically, Uppy requires access to the <code>ETag</code> header returned by each uploaded part to assemble the final completion manifest:

[
  {
    "AllowedOrigins": ["https://app.example.com"],
    "AllowedMethods": ["GET", "PUT", "POST", "DELETE", "HEAD"],
    "AllowedHeaders": ["*"],
    "ExposeHeaders": ["ETag"],
    "MaxAgeSeconds": 3600
  }
]

Watch out: If ETag is not included in ExposeHeaders, the browser cannot read the part identifier from the response. Uppy will fail at the completion step with an empty part list error.

Backend signing endpoints in Python

Uppy's <code>@uppy/aws-s3-multipart</code> plugin expects four lightweight REST endpoints from your backend:

  • POST /s3/multipart: Calls CreateMultipartUpload, returning uploadId and key.
  • GET /s3/multipart/:uploadId/batch: Generates presigned PUT URLs for each chunk index.
  • POST /s3/multipart/:uploadId/complete: Calls CompleteMultipartUpload with the assembled part list.
  • DELETE /s3/multipart/:uploadId: Calls AbortMultipartUpload if the user cancels.

Here is a clean implementation using Python and FastAPI with boto3:

import boto3
from botocore.config import Config
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel

app = FastAPI()
s3 = boto3.client(
    "s3",
    endpoint_url="https://s3.tport.space",
    config=Config(signature_version="s3v4", s3={"addressing_style": "path"})
)
BUCKET = "customer-uploads"

class InitRequest(BaseModel):
    filename: str
    contentType: str

@app.post("/s3/multipart")
def init_upload(req: InitRequest):
    key = f"incoming/{req.filename}"
    res = s3.create_multipart_upload(
        Bucket=BUCKET,
        Key=key,
        ContentType=req.contentType
    )
    return {"uploadId": res["UploadId"], "key": key}

@app.get("/s3/multipart/{upload_id}/batch")
def sign_parts(upload_id: str, key: str, partNumbers: str):
    parts = [int(p) for p in partNumbers.split(",")]
    presigned = {}
    for part_num in parts:
        url = s3.generate_presigned_url(
            ClientMethod="upload_part",
            Params={
                "Bucket": BUCKET,
                "Key": key,
                "UploadId": upload_id,
                "PartNumber": part_num,
            },
            ExpiresIn=900  # 15 minutes
        )
        presigned[str(part_num)] = url
    return {"presignedUrls": presigned}

class PartInfo(BaseModel):
    PartNumber: int
    ETag: str

class CompleteRequest(BaseModel):
    key: str
    parts: list[PartInfo]

@app.post("/s3/multipart/{upload_id}/complete")
def complete_upload(upload_id: str, req: CompleteRequest):
    parts_payload = [{"PartNumber": p.PartNumber, "ETag": p.ETag.strip('"')} for p in req.parts]
    res = s3.complete_multipart_upload(
        Bucket=BUCKET,
        Key=req.key,
        UploadId=upload_id,
        MultipartUpload={"Parts": parts_payload}
    )
    return {"location": res.get("Location"), "key": req.key}

@app.delete("/s3/multipart/{upload_id}")
def abort_upload(upload_id: str, key: str):
    s3.abort_multipart_upload(Bucket=BUCKET, Key=key, UploadId=upload_id)
    return {"status": "aborted"}

Frontend setup with Uppy

In the browser, initialize Uppy with the <code>@uppy/aws-s3-multipart</code> plugin. Set <code>partSize</code> to at least 10 MB (10,485,760 bytes) and enable automatic retry logic:

import Uppy from '@uppy/core';
import Dashboard from '@uppy/dashboard';
import AwsS3Multipart from '@uppy/aws-s3-multipart';
import '@uppy/core/dist/style.min.css';
import '@uppy/dashboard/dist/style.min.css';

const uppy = new Uppy({
  restrictions: {
    maxFileSize: 50 * 1024 * 1024 * 1024, // 50 GB limit
    allowedFileTypes: ['video/*', 'application/zip', 'image/*']
  }
})
.use(Dashboard, { target: '#uploader', inline: true })
.use(AwsS3Multipart, {
  limit: 4, // 4 parallel part uploads
  partSize: 10 * 1024 * 1024, // 10 MB chunks
  retryDelays: [0, 1000, 3000, 5000],
  async createMultipartUpload(file) {
    const res = await fetch('/s3/multipart', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ filename: file.name, contentType: file.type })
    });
    return res.json();
  },
  async signPart(file, { uploadId, key, partNumber }) {
    const res = await fetch(`/s3/multipart/${uploadId}/batch?key=${encodeURIComponent(key)}&partNumbers=${partNumber}`);
    const data = await res.json();
    return { url: data.presignedUrls[partNumber] };
  },
  async completeMultipartUpload(file, { uploadId, key, parts }) {
    const res = await fetch(`/s3/multipart/${uploadId}/complete`, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ key, parts })
    });
    return res.json();
  },
  async abortMultipartUpload(file, { uploadId, key }) {
    await fetch(`/s3/multipart/${uploadId}?key=${encodeURIComponent(key)}`, { method: 'DELETE' });
  }
});

Cleaning up abandoned part uploads

When users close their browser tabs mid-upload, uploaded parts remain in the bucket indefinitely unless explicitly aborted. Although incomplete objects are invisible to normal file listings, storage providers bill for the stored chunk bytes until the upload is completed or aborted.

Always configure a bucket lifecycle rule to automatically abort incomplete multipart uploads after 3 to 7 days:

{
  "Rules": [
    {
      "ID": "abort-incomplete-multipart",
      "Status": "Enabled",
      "Filter": { "Prefix": "" },
      "AbortIncompleteMultipartUpload": {
        "DaysAfterInitiation": 3
      }
    }
  ]
}

Object storage architecture on tport.space

<b>tport.space</b> provides an S3-compatible object storage API designed for scalable file ingestion with zero egress fees on downstream reads. Direct browser uploads with Uppy work seamlessly with standard SigV4 endpoints, allowing you to ingest terabytes of user data without proxy server bottlenecks.

Explore our related storage engineering guides:

Build high-speed browser uploads directly to S3-compatible storage with zero egress fees.

Deploy on tport.space