Backend/File storage

File storage

Keep uploaded files for real. This page lists what happens to uploads today and how to store them privately per workspace.

What happens to uploads today

WhereToday
Documents library, and a company's Files tabSaves the name, size and note; the file itself isn't kept
Message attachmentsA temporary browser link that's gone after a reload
Attachments in the agent chatOnly the file name is shown
Images in notesA temporary browser link
Workspace logo (New workspace)A temporary browser link
Company logo (company settings)Kept in memory until you reload
Profile photo (sign-up)Shrunk and saved in this browser's storage

CSV import in Settings is different: it reads the file into records, so it belongs with your database rather than file storage.

Connect file storage

Choose storage. Supabase Storage, Amazon S3 and Vercel Blob are examples; they all store files and give you links to them.

Upload through your server. Small files can go through a Server Action (Next.js accepts 1 MB by default); for larger files, create a signed upload URL on the server and let the browser upload straight to storage.

Save a record for each file in your database: workspace, uploader, name, size, type and storage path. Screens like Documents then list those records, as they list demo data today.

Upload and share a file (Supabase example)
// On the server, after checking the person's workspace
const path = `${workspaceId}/${crypto.randomUUID()}-${file.name}`
const { error } = await supabase.storage.from("documents").upload(path, file)
if (error) throw error

// Later: a link that works for 60 seconds
const { data } = await supabase.storage.from("documents").createSignedUrl(path, 60)

Shrink images such as logos and profile photos before you store them, and delete files when their record is deleted.

Keep files private

  • Private by default. Use private storage where your provider offers it, and hand out short-lived signed links only after checking that the person belongs to the file's workspace.
  • Limit size and type on the server. The file picker's filter is easy to get around; check again before you store anything.
  • Keep storage keys on the server. The browser only ever gets a signed link.

Customer files often contain personal data. Have someone technical review how files are stored, shared and deleted before real customers upload them.