Media
Upload and list files, allowed types, where files live, and the media package’s S3 and derivatives.
6 min read
Admin → Media. Uploads go through POST /api/media (multer, memory, 100 MB max) as administrator, editor, or author. GET /api/media?limit= lists rows. Files are served from GET /uploads/*.
Allowed types (admin route)
- Images: JPEG, PNG, GIF, WebP, AVIF.
- Documents: PDF.
- Video: MP4, WebM.
- Audio: MPEG, Ogg.
- SVG is not on the server allow-list.
Where files go
The live upload path writes {STORAGE_LOCAL_PATH or ./uploads}/{siteId}/{uuid}.ext and a database row. Hooks: media.beforeUpload / media.beforeDelete (gates), media.uploaded / media.deleted (actions), filter media.metadata.
Package: `@justflows/media`
MediaService supports local and S3 adapters and Sharp derivatives: thumbnail 150², small 400, medium 800, large 1600, as WebP. Configure STORAGE_DRIVER=s3 and the S3_* keys as in Configuration. The CE admin upload route does not yet call this service for every upload — local disk is what the wizard and Media page use today.