Jump to content

Uploading Files

From PUBLISH DATE
Revision as of 02:08, 19 February 2026 by Jasongeek (talk | contribs) (Created page with "= Uploading Files = MediaWiki allows users to upload images, documents, and other media files for use within wiki pages. This guide explains how to enable uploads and how to properly insert files into pages. == Enabling File Uploads (Administrators) == If you manage the wiki, make sure uploads are enabled in <code>LocalSettings.php</code>: <syntaxhighlight lang="php"> $wgEnableUploads = true; $wgFileExtensions = [ 'png', 'jpg', 'jpeg', 'gif', 'pdf', 'svg', 'webp' ];...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Uploading Files

MediaWiki allows users to upload images, documents, and other media files for use within wiki pages. This guide explains how to enable uploads and how to properly insert files into pages.

Enabling File Uploads (Administrators)

If you manage the wiki, make sure uploads are enabled in LocalSettings.php:

<syntaxhighlight lang="php"> $wgEnableUploads = true; $wgFileExtensions = [ 'png', 'jpg', 'jpeg', 'gif', 'pdf', 'svg', 'webp' ]; $wgMaxUploadSize = 10485760; // 10MB </syntaxhighlight>

Ensure the /images directory is writable by the web server.

You may also need to allow user permissions:

<syntaxhighlight lang="php"> $wgGroupPermissions['user']['upload'] = true; $wgGroupPermissions['autoconfirmed']['upload'] = true; $wgGroupPermissions['user']['reupload'] = true; $wgGroupPermissions['user']['reupload-own'] = true; </syntaxhighlight>

Uploading a File

  1. Log in to your account.
  2. Navigate to Special:Upload.
  3. Click Choose File.
  4. Enter a destination filename.
  5. Add a description and licensing information.
  6. Click Upload file.

After uploading, the file will be available at:

File:Filename.ext

Using Uploaded Files in Pages

Display an Image

<syntaxhighlight lang="wiki">

File:Example.jpg
Caption here

</syntaxhighlight>

Display Without Thumbnail

<syntaxhighlight lang="wiki"> File:Example.jpg </syntaxhighlight>

<syntaxhighlight lang="wiki"> File:Document.pdf </syntaxhighlight>

To create a direct link:

<syntaxhighlight lang="wiki"> File:document.pdf </syntaxhighlight>

Allowing Additional File Types

To allow additional formats:

<syntaxhighlight lang="php"> $wgFileExtensions[] = 'svg'; $wgFileExtensions[] = 'webp'; </syntaxhighlight>

To disable strict file extension checking:

<syntaxhighlight lang="php"> $wgStrictFileExtensions = false; </syntaxhighlight>

Troubleshooting

Problem Solution
Upload option missing Ensure $wgEnableUploads = true;
File type not allowed Add the extension to $wgFileExtensions
Permission denied Check folder permissions on the /images directory
File too large Increase $wgMaxUploadSize and PHP upload_max_filesize

See Also