Media API
Upload Content
Upload media content. Returns a content_uri for use in messages.
Response:
Upload with filename
Download Content
Returns the raw media content with appropriate Content-Type.
Create Thumbnail
Thumbnails are cached on disk as thumb_{mediaId}_{w}x{h}_{method}.jpg.
URL Preview
Response:
SSRF Protection
URL preview validates that the target URL is not an internal/private address:
- Blocks
localhost,127.x.x.x,10.x.x.x,192.168.x.x,172.16-31.x.x - Blocks IPv6 loopback
- Returns
M_FORBIDDENwith HTTP 400 on violation
Preview Cache
URL preview results are cached in the media_url_preview table with a 3600-second TTL.
Media Metadata
Uploaded media metadata is stored in the media_metadata table:
Remote Media
When a federated server sends a media reference, Firmiana downloads and caches the content locally. Connection failures return HTTP 502 (Bad Gateway).