Whitelist upload MIME types per office island #150

Open
opened 2026-04-26 08:19:02 +00:00 by zaelgohary · 0 comments
Member

The Upload button in every office island currently accepts any file. Uploading cat.png through Sheets succeeds at the hero_foundry level but produces a list entry that crashes OnlyOffice when clicked. Each island should restrict by its DocType.

Acceptance

  • DocType exposes an accept_extensions() and/or accept_mime() helper:
    • Cell -> xlsx, xls, xlsm, xlsb, csv, ods, ots, fods, ...
    • Word -> docx, doc, docm, odt, rtf, txt, ...
    • Slide -> pptx, ppt, pptm, odp, ...
    • Pdf -> pdf
    • Diagram -> vsdx, vsdm, vssx, ...
  • <input type=file> in FileListView sets the accept attribute from that helper so the OS picker filters by default.
  • Server-side check in service::upload_file (or hero_office_server if hero_foundry is the wrong layer) rejects mismatched extensions with a clear error rather than letting them land.
The `Upload` button in every office island currently accepts any file. Uploading `cat.png` through Sheets succeeds at the hero_foundry level but produces a list entry that crashes OnlyOffice when clicked. Each island should restrict by its `DocType`. ## Acceptance - `DocType` exposes an `accept_extensions()` and/or `accept_mime()` helper: - `Cell` -> xlsx, xls, xlsm, xlsb, csv, ods, ots, fods, ... - `Word` -> docx, doc, docm, odt, rtf, txt, ... - `Slide` -> pptx, ppt, pptm, odp, ... - `Pdf` -> pdf - `Diagram` -> vsdx, vsdm, vssx, ... - `<input type=file>` in `FileListView` sets the `accept` attribute from that helper so the OS picker filters by default. - Server-side check in `service::upload_file` (or `hero_office_server` if hero_foundry is the wrong layer) rejects mismatched extensions with a clear error rather than letting them land.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_archipelagos#150
No description provided.