Skip to content
← Blog

How to add file uploads to an app Claude built

Add file uploads to an app Claude or Claude Code built: one storage block in floo.app.toml gives the app private buckets for dev and prod and S3 keys in its environment. Claude writes the upload form and the download links.

floo team

TL;DR

To add file uploads to an app Claude built, add [managed.files] with type = "storage" to floo.app.toml. floo creates private buckets for dev and prod and gives the app S3 keys. Claude writes the upload form with the standard S3 SDK and serves files through signed links that expire.

  • Files stay between deploys. The container's own disk does not.
  • Any S3 client works: AWS SDK for Node, boto3, Rails Active Storage.
  • Buckets are private. The app decides who gets a link.

Receipts, contracts, photos, CSV exports: sooner or later an app needs to keep files. The mistake Claude can make on its own is saving them to a folder in the app. That works on a laptop and loses every file on the next deploy.

1. Add storage

[managed.files]
type = "storage"

Deploy, and floo creates a private bucket for dev and another for prod. The app's environment gets the bucket name and S3 keys, named after the block: STORAGE_BUCKET_FILES, STORAGE_S3_ENDPOINT_FILES, STORAGE_S3_ACCESS_KEY_ID_FILES, STORAGE_S3_SECRET_ACCESS_KEY_FILES, and STORAGE_S3_REGION_FILES.

2. Ask Claude for the upload flow

Add receipt uploads to the expense form. Store each file in floo storage with the AWS S3 SDK, using the STORAGE_*_FILES environment variables, under uploads/ followed by the expense id. Save the object key on the expense row. On the expense page, show a download link that expires after 15 minutes. Only the person who submitted the expense or an admin can download it.

That prompt names the three decisions that matter: where the file goes, where the app remembers it, and who can get it back.

3. Check the client settings

Recent AWS SDKs send optional checksums that floo's S3 interface rejects. The fix is two settings on the client:

const s3 = new S3Client({
  endpoint: process.env.STORAGE_S3_ENDPOINT_FILES,
  region: process.env.STORAGE_S3_REGION_FILES,
  credentials: {
    accessKeyId: process.env.STORAGE_S3_ACCESS_KEY_ID_FILES,
    secretAccessKey: process.env.STORAGE_S3_SECRET_ACCESS_KEY_FILES,
  },
  requestChecksumCalculation: "WHEN_REQUIRED",
  responseChecksumValidation: "WHEN_REQUIRED",
});

If an upload fails with a checksum error, point Claude at this block or at the storage guide.

Things to get right

  • Never use the container's disk. It is wiped on deploy and not shared between copies.
  • Store the key, not the file, in Postgres. The row holds uploads/123/receipt.pdf; the bucket holds the bytes.
  • Check who is asking before signing a link. In a team app, the signed-in user's email arrives in X-Floo-User-Email.
  • Mind the 10 MB default. floo's gateway forwards request bodies up to 10 MB. Raise it with max_request_body_mb in [resources], up to 100, or have the browser upload straight to the bucket with a signed upload policy, also up to 100 MB, as the storage guide shows.

Dev and prod have separate buckets, so test files never mix with real ones. For login on the same app, see how to add login to an app Claude built.

Frequently asked questions

How do I add file uploads to an app Claude built?

Add a [managed.files] block with type = "storage" to floo.app.toml and deploy. floo creates private buckets for dev and prod and puts S3 keys in the app's environment. Ask Claude to add an upload form that stores files with the AWS S3 SDK and serves them through short-lived signed links.

Where should uploaded files go in a hosted app?

In object storage, not the container's disk. A container's disk is wiped on every deploy and isn't shared between copies of the app. floo's storage keeps files between deploys and works with any S3 client.

Are uploaded files public?

No. The buckets are private. The app hands out a signed link that expires, so only someone the app chose can open a file.

Get your app live.

read https://getfloo.com/agents.md and set me up on floo

Get an API key
Usage-based pricing. See plans →