Uploading & downloading files

The upload-then-attach flow, and secure vs public files.

  • 4 min read
On this page
  1. Upload, then attach
  2. Secure vs public files
  3. Downloading

Upload, then attach #

Files are a two-step flow: upload the bytes to get a file id, then attach that id to a record field. Doing it in one step is the most common file bug.

TypeScript
// 1. upload
const up = await tada.files.upload(fileBytes, { name: 'contract.pdf', type: 'application/pdf' });
const fileId = up.data?.file_id;

// 2. attach to a File/Image field on the record
await tada.records.update('contracts', recordId, { field_20: [{ file_id: fileId }] });

Secure vs public files #

Whether a file is protected is a property of the field, set in the Tadabase builder:

Field settingBehavior
SecureStored in a private bucket. Downloads use short-lived signed URLs (about 10 minutes) fetched per request.
PublicPermanent CDN link — fine for logos and public assets, wrong for anything sensitive.

Downloading #

tada.files.get(fileId) returns metadata plus a fresh download URL. For secured files, always fetch a new URL at download time rather than storing one — the old link expires.

Skip the docs.Just describe it.

Tadabase AI builds it, hosts it and keeps it running. Real backend, real domain, real app.

Plain English. It asks follow-up questions like a real developer.

  • Free plan, no card
  • Unlimited app users
  • Live on your own domain