For all uploaded files we use the magic library (or similar) to confirm the filetype on the server side.
We append a user message with instructions stating the mimetype of the file.
For # 1, we would ideally send a message back to the user if this was an unsupported filetype and ask them to try again. If that's more complicated, I'd be happy to move that to a separate issue instead of blocking on it.
For # 2, here's a first pass on that instruction:
I have confirmed file is of type `{mimetype}`, so proceed to process it that way without any additional checks.
Relevant threads on Slack: https://dimagi.slack.com/archives/C05PK63Q89H/p1722930702167019 https://dimagi.slack.com/archives/C05PK63Q89H/p1723539681446419
I am proposing we implement two changes:
magic
library (or similar) to confirm the filetype on the server side.For # 1, we would ideally send a message back to the user if this was an unsupported filetype and ask them to try again. If that's more complicated, I'd be happy to move that to a separate issue instead of blocking on it.
For # 2, here's a first pass on that instruction: