I would like to enable all file uploads in Media-Wiki (aside from the ones which are explicitly blacklisted like .exe
).
Environment
I am using a virtual-box Linux turnkey ova appliance (turnkey-mediawiki-16.0-buster-amd64) which comes with 16.0 preinstalled.
What I tried 1
I have modified the LocalSettings.php
in several ways to get it working. I have had success uploading some files.
Problem is I have a file type (.drawio) which actually contains XML when opened in a text editor. When I upload these I get this error:
File extension ".drawio" does not match the detected MIME type of the file (application/xml).
I can upload the same file if I change the extension to .xml
. But I want to force people to change file extensions just to get it to upload.
When they download these files the app looks for this extension and they will have to rename them every time. It will get annoying quickly.
What I tried 2
- I set
$wgFileUpload = On
- I added
drawio
andxml
both to the list of$wgFileExtensions
. - I made sure
application/xml
is an allowed mime-type in $wgTrustedMediaFormats
. - I tried disabling mime-type validation by setting both
$wgCheckFileExtensions
and$wgStrictFileExtensions
tofalse
.
Context
This is for internal, non-public document wiki so I trust the folks using it and I am comfortable with disabling file extension validation and allowing all file types.
Any other thoughts on what I can try?