How to allow any file type upload (MediaWiki)

Send Us a Sign! (Contact Us!)
Word PDF Epub Text
XML OpenOffice XPS MHT

Just go into your LocalSettings.php file and add these lines (or change their values if the variables are already mentioned in this file):

$wgCheckFileExtensions = false;

$wgVerifyMimeType = false;
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg' );

Note: you'll need only these three variables to unrestrict file types upload process...but if you want to control some file types extensions you could use the following variables:

$wgStrictFileExtensions = false;

$wgFileBlacklist = array();
$wgMimeTypeBlacklist= array();

This approach could be useful if your MediaWiki installation is only for your own personal use and you are sick and tired of it telling you couldn’t [gs upload] this and that file type.

[tweet]

Note that if a file extension is listed in the [gs variable] $wgFileBlacklist then it doesn’t matter how you change the other variables, it will be blocked!

SOURCE

LINK

LANGUAGE
ENGLISH

2 thoughts on “How to allow any file type upload (MediaWiki)”

Comments are closed.