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
| Field | Notes |
|---|---|
id / accountId | Standard |
entityType | The entity type the attachment binds to |
entityId | The specific entity row |
fileName | Original filename |
contentType | MIME type |
sizeBytes | |
storageKey | Key in the object store |
uploadedBy | User id |
uploadedAt | ISO 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:
- Validates entity ownership against the caller's
accountId - Streams the file to MinIO / R2 with a content-addressed key
- Inserts the
attachmentsrow - 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/.ldxlands, kick off the KPI worker (Phase 5) - Versioning — replace a file and keep history