Expanding the list of file extensions for in-app preview

We have a bunch of file uploaded to mattermost, they are all extension .lic (a license file). Its essentially a json file, but Mattermost by default does not show the content when clicked, instead offers to download.

is there some way to reconfigure mattermost instance to treat .lic files as if they were json (or even txt)?

A configurable list of supported mime types and previewers?

Hi mmix,

this is actually an interesting question and while trying to dig a bit into it I found out that you can immediately activate the file preview for .lic files when you change the extension attribute of their entries in the fileinfo table in the database to txt (and restart the server afterwards).
While this doesn’t help you for newly posted .lic files, you could at least make the existing ones work now (if this is relevant, not sure if the preview is only relevant for newly uploaded files).
I’ve asked the developers if it’s possible to generate the preview based on the mimetype (which would help us out in this situation) and will update you as soon as I hear from them.

Yea, a configurable way (even if its a postgresql table) to associate extensions with mimetype and/or previewer would be cool.

Also, they could do a fallback, where as if a file has utf signature or its content is ascii, it could offer a text based preview regardless of extension.

Hi, any news on this?

No, sorry - my discussion with the developers went stale, will try to revive it.

This would still be useful :slight_smile: