Reading the dashboard's own bundle settled where the file endpoints
are. It exposes upload as POST /api/v1/files, fetch-by-name as
GET /api/v1/files/content?filename=, and fetch-by-id as
GET /api/v1/files/{id}/content, and it fetches a chat image by name.
Both of our endpoints were wrong in different ways. Upload posted to
/api/v1/file, singular. Download used the by-id form with the id from
the attachment_saved frame, which does not address the file — asking for
it returned the dashboard's HTML shell with HTTP 200, which is what
surfaced as a broken image.
The name was there all along: the media frame carries [IMAGE]{uuid}.jpg
and the mapper discarded it, waiting for the id in the frame after.
Emit the marker from the media frame instead, naming the file, and keep
the saved id as a fallback for a media frame that names nothing usable.
A reference carrying a path or a scheme is refused rather than guessed
at, since the by-name fetch cannot express either.
Refs: N-6.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>