How to Configure MediaWiki File Uploads

Updated on December 17, 2022

In this article you will learn how enable or disable uploads, and how to configure who can upload.

With MediaWiki you can upload images and other files. Each file has its own wiki page, can be embedded in other pages and has its own version history.

On basic MediaWiki, file uploads are disabled by default. In contrast, ProWiki comes with file uploads enabled by default, though only for administrators.

Enable MediaWiki File Uploads

If you are using ProWiki MediaWiki hosting you can enable file uploads via the admin panel. Go to the Editing tab.

File upload options in the ProWiki admin panel

If you are using basic MediaWiki, you will need to edit the LocalSettings.php configuration file. This is rather technical and requires server access.

  • Start editing LocalSettings.php
  • Find $wgEnableUploads = false; and replace it with $wgEnableUploads = true;
  • If there is no such line yet, simply add $wgEnableUploads = true; to the end of the file
  • Make sure there is only one line with $wgEnableUploads
  • Save LocalSettings.php

You also need to ensure that the server has sufficient disk space, and that the webserver is configured to allow file uploads.

Disable MediaWiki File Uploads

If you are using ProWiki MediaWiki hosting you can enable file uploads via the admin panel. Go to the Editing tab.

File upload options in the ProWiki admin panel

If you are using basic MediaWiki, you will need to edit the LocalSettings.php configuration file. This is rather technical and requires server access.

  • Start editing LocalSettings.php
  • Find $wgEnableUploads = true; and replace it with $wgEnableUploads = false;
  • If there is no such line yet, simply add $wgEnableUploads = false; to the end of the file
  • Make sure there is only one line with $wgEnableUploads
  • Save LocalSettings.php

MediaWiki Upload Permissions

If you are using ProWiki MediaWiki hosting you can manage upload permissions via the the admin panel Permissions tab.

File upload permission settings in the ProWiki admin panel

If you are using basic MediaWiki, you will need to edit the LocalSettings.php configuration file. This is rather technical and requires server access.

On basic MediaWiki, all registered users can upload files once file uploads are enabled.

To restrict who can upload files to your wiki:

  • Start editing LocalSettings.php
  • Remove any lines with $wgGroupPermissions['XYZ']['upload'], where XYZ can be anything
  • Add $wgGroupPermissions['user']['upload'] = false; to the end of the file
  • To allow administrators (users in the sysop group) to upload, add $wgGroupPermissions['sysop']['upload'] = true; to the end of the file
  • Save LocalSettings.php