Attachments viewer - wrong file type


I’m having a lot of .aes files as attachments. When I click them, the wiki tries to play them as a media file, and I can’t download them.
I tried to blacklist the mime-type and force the download in the I set log for attachments on Debug but I won’t get any output.

Example: application/octet-stream application/octet-stream

Am I missing something?

Are you sure those attachments are saved with this mime type ? It’s very unlikely, as otherwise I doubt the browser would open them.

The file --mime-type command tells me:
root@webserver:/var/lib/xwiki/data# file --mime-type […] /var/lib/xwiki/data/store/file/xwiki/2/4/2256632bfef110b6b78ef0b302e2b8/attachments/5/d/593c0e2f2ee01109f5231da68bebf5/fv1.2.aes: application/octet-stream

I tried to look in the log file but can’t find any output there. I have set debug and upload several files.

Keep in mind that “application/octet-stream” is basically the same as saying “I don’t know what is the mime type”. XWiki does not use file to find the mime type, so it’s not a very accurate way to check it.

I guess the fastest to find out exactly which mime type this file is associated with in XWiki is to open your browser Network tab, open the media file and see which “content-type” (which is the mime type and the encoding) you end up with in the Response Headers.

Now it works perfectly. Thank you.
File gets recognized as audio/mpeg