Skip to content
s3nd.sh

Template

Your own WeTransfer, on your own bucket.

Drop a file, get an eight-character code and a link, pick it up on any device until it expires. One Next.js app built on the library and the hooks, deployed to Vercel in one click with five environment variables.

.env.local
S3ND_BUCKET=drop
S3ND_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com
S3ND_REGION=auto
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

# optional
DROP_PASSWORD=              # ask for it before an upload
DROP_EXPIRES_IN=86400        # seconds, one day
DROP_MAX_SIZE_MB=4           # under Vercel's 4.5 MB request limit

01What you get

Two pages and one route.

The upload page, the pickup page, and the transfer handler between them. Everything else is yours to restyle.

A drop zone

Drag a file in or pick one. It lands in your bucket under a fresh code with an expiry stamped on the object, and the page shows the code on a split-flap board next to the link to share.

A pickup page

/K7QP2M4X shows the filename, the size and the time left, then hands the bytes over. An unknown or expired code gets the same 404, so nobody can probe which codes were used.

One route file

createTransferHandler() serves the four-route protocol, so the CLI works against your deployment too: s3nd put --remote https://drop.s3nd.sh/api/transfers.

An optional password

Set DROP_PASSWORD and uploading asks for it; picking up never does. Without it, anyone who finds the page can drop a file in your bucket, which is fine behind a proxy and not fine on the open internet.

02Setup

Five variables, one lifecycle rule.

The bucket and a key pair scoped to it. Vercel asks for them when you deploy; locally they go in .env.local.

  1. 01Create a bucket on R2, S3, Scaleway, Wasabi or a MinIO you host, and a key pair with read and write on that bucket and nothing else.
  2. 02Click Deploy, paste the five values, wait for the build.
  3. 03Add a lifecycle rule that deletes objects under the prefix after a day or two: the expiry stops a transfer being handed over, only the rule deletes the object.
  4. 04Run npx @s3nd/cli doctor --remote https://drop.s3nd.sh/api/transfers and watch it round-trip a real transfer.
Deploy with Vercel

03Worth knowing

What it does not do, yet.

4.5 MB on Vercel

A file goes through the function, so Vercel’s request limit applies. DROP_MAX_SIZE_MB sets the ceiling below it, and an oversized file is refused before anything is uploaded. Presigned browser uploads, which lift the limit, are on the roadmap.

No accounts

The code is the whole handshake, and it is a bearer token. The default expiry is a day; shorten it with DROP_EXPIRES_IN for anything sensitive, or encrypt before dropping.

Restyle freely

Tailwind, two pages, no design system to learn. The split-flap board and the amber are the site’s identity, not the template’s contract.

Put a file. Hand over the code.

Point it at the bucket you already pay for. Nothing to deploy, nothing to sign up for, nothing in the middle.