Cloudflare Pages Function + AWS S3

Sign first, upload second.

This rebuild moves the upload path into a Pages Function. The frontend no longer carries AWS long-term credentials or any reusable bucket URL. The browser uploads to the function, and the function forwards the file to S3.

  • Auth happens at the edgePages Function validates the request and the gate key before the file ever reaches S3.
  • Browser talks only to Pages FunctionThe browser uploads the file as multipart form data, so it never needs a direct S3 URL or CORS rule.
  • Function forwards to S3The file is streamed from the function to S3, keeping the AWS credentials and bucket details server-side.
01

1. Enter the gate key and choose a file

02

2. Pages Function validates the request

03

3. Function streams the file to S3

Upload console

Upload through the Pages Function

The browser sends the file to the Pages Function. The function validates the request, streams it to S3, and keeps AWS long-term credentials on the server.

Limit100 MB
ModeMultipart upload
BackendCloudflare Pages Function