MediaWiki Images

Enable and Manage Uploads in MediaWiki

This tutorial covers the following topics:

The first step you need to take before uploading images, is to ensure the following:

  • The images directory is writable. If not - you may easily change the folder's permissions via the File Manager tool in your cPanel or over FTP.
  • Upload in MediaWiki is enabled. To do this, you should open the LocalSettings.php file for editing and make sure that the $wgEnableUploads is set to true as shown below:

  • The file's extension is allowed for upload. To confirm this, open the includes/DefaultSettings.php file for editing. Then search for the $wgFileExtensions variable. It should look like the line below:

If the file's extension is not present, you can edit the file and add it manually. As an alternative, you may allow most file types to be uploaded by changing the $wgStrictFileExtensions variable to false.

  • You should also make sure you are logged in the MediaWiki application.

Upload Permissions

By default, all registered users can upload files. To change this, you have to modify the $wgGroupPermissions variable in includes/DefaultSettings.php. To prevent normal users from uploading files, you should set:

To create a special group called uploadaccess, and allow members of this group to upload files, you should set:

To allow autoconfirmed (non-newbie) users to upload files, you should set:

Uploading Directly from a URL

You can allow users to directly upload files from a URL. To allow this, in includes/DefaultSettings.php you should set:

To add an image to a post, you need to indicate it in your post as an image using:

(where test.png is the name of the image).

You can also add thumbnailed images using:

The image can be aligned so that you can add text next to it. Here is an example how to create a left alligned image: