Appearance
Media & Files
- File:
Controllers/MediaController.cs,Controllers/FilesController.cs,Resolvers/MediaResolvers.cs,Features/Media/...
Overview
Media and file handling covers uploads (user files, event attachments, images), serving files back to clients, image processing (thumbnails via SkiaSharp), and shared file downloads. All binary storage goes through the hvc-storage abstraction (Azure Blob / MinIO / S3 / local), so the API never touches storage providers directly.
REST endpoints
Media (api/media/...)
| Endpoint | Purpose |
|---|---|
POST /api/media/upload | Upload a file (UploadContent form); returns a CallResult |
GET /api/media/download/{tenant}/{hash}?forceDownload= | Download a file by tenant + hash |
GET /media/download/{tenant}/{hash} | Alias of the above |
Files (api/files/...)
| Endpoint | Purpose |
|---|---|
GET /api/files/shared/{filePath} | Download a shared file |
GET /files/{tenantId}/{container}/{*path} | Read a file from a tenant container |
Upload flow
- Client POSTs a multipart form to
/api/media/upload. - The API validates size/extension against tenant upload config.
- The file is stored via
HvcStorageFactory.getClientStore()under a Hashids-derived object name (HvcHashProvider). - A
MediaFilerecord (and optionalFileShare) is created for the event/session.
Image processing
Images are processed with SkiaSharp (resize/thumbnails) before storage; the web app uploads via URQL multipart exchange + FilePond, and mobile apps upload via the media controller or queue uploads through ObjectBox (MediaController.syncFiles).
Upload configuration
Tenant admins configure allowed file types and max sizes (see Web admin — Uploads); the API enforces size and extension server-side and validates known file headers.
Related
- Storage — the abstraction used for persistence.
- Web Ledger — event attachments/files UI.