How to Make MediaWiki Allow All File Types


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;
$wgStrictFileExtensions = false;
$wgVerifyMimeType = false;
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg' );
$wgFileBlacklist = array();
$wgMimeTypeBlacklist= array();

Since my MediaWiki installation is only for my own personal use, I got sick and tired of it telling me I couldn’t upload this and that file. What really took me a while to figure out is that if a file extension is lised in the variable $wgFileBlacklist then it doesn’t matter how you change the other variables, it will be blocked! (at least for version 1.6.8 of MediaWiki.)

My Search Terms:

  1. mediawiki upload formats
  2. “.py” + “is not a recommended image file format”
  3. “.py” is not a recommended image file format.
  4. mediawiki allow all upload files formats
  5. mediawiki allow all uploads
  6. mediawiki settings upload

One Response to “How to Make MediaWiki Allow All File Types”

  1. Ritesh says:

    Nice tip. I was having the same problem.