Jump to content

Uploading Files: Difference between revisions

From PUBLISH DATE
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' ];..."
 
No edit summary
 
Line 1: Line 1:
= Uploading Files =
= 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.
Publish Date 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 insert files into pages properly.
 
== 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' ];
$wgMaxUploadSize = 10485760; // 10MB
</syntaxhighlight>
 
Ensure the <code>/images</code> 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 ==
== Uploading a File ==

Latest revision as of 02:09, 19 February 2026

Uploading Files

[edit]

Publish Date 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 insert files into pages properly.

Uploading a File

[edit]
  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

[edit]

Display an Image

[edit]

<syntaxhighlight lang="wiki">

File:Example.jpg
Caption here

</syntaxhighlight>

Display Without Thumbnail

[edit]

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

[edit]

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

To create a direct link:

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

Allowing Additional File Types

[edit]

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

[edit]
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

[edit]