Skip to main content

Attachments

Attachments are arbitrary files (telemetry blobs, photos, PDFs, videos) bound to an entity in Race Platform. They're stored in S3-compatible object storage (MinIO locally, Cloudflare R2 in production) and referenced by an attachments row.

What's stored

FieldNotes
id / accountIdStandard
entityTypeThe entity type the attachment binds to
entityIdThe specific entity row
fileNameOriginal filename
contentTypeMIME type
sizeBytes
storageKeyKey in the object store
uploadedByUser id
uploadedAtISO datetime

Upload flow

curl -X POST http://localhost:6161/attachments/upload \
-H "Authorization: Bearer $TOKEN" \
-F "entityType=Run" \
-F "entityId=<uuid>" \
-F "file=@motec.ld"

The endpoint:

  1. Validates entity ownership against the caller's accountId
  2. Streams the file to MinIO / R2 with a content-addressed key
  3. Inserts the attachments row
  4. Returns the row including a presigned download URL

Where attachments appear in the app

  • Run Sheet → Files tab — drop files here to attach them to the run sheet
  • (Roadmap) Per-entity Files section on Setups, Tyres, Lap rows

What you can do today

  • Upload any file via /attachments/upload
  • List attachments via GET /attachments?entityType=...&entityId=...
  • Download via the presigned URL returned in the list response
  • Delete via DELETE /attachments/:id
  • Drag-and-drop into the Run Sheet Files tab

What's coming

  • Per-entity Files tabs on other entities (Setups, Tyres)
  • Auto-download — mark a file to download to every user's client automatically (HH-DM has this)
  • In-app preview for photos, PDFs, plain text
  • Telemetry file processing pipeline — when a .ld / .ldx lands, kick off the KPI worker (Phase 5)
  • Versioning — replace a file and keep history