Monday, October 18, 2010

Media Wiki - Upload file configuration

To enable uploading of files on media wiki, first enable the settings on PHP.INI

file_uploads = On

Then on your LocalSettings.php (under wiki site root folder), apply these changes:

Turn on the file upload:

$wgEnableUploads   = true

Set your upload directory. This is where your uploaded files will be saved:

$wgUploadDirectory = "c:/Sites/PHP/mediawiki-1.16.0/uploads";

Set your upload url. This is the url to use for downloading your files.

$wgUploadPath  = $wgScriptPath."/uploads";
For example:

To modify the file types that can be uploaded:
$wgFileExtensions = array_merge($wgFileExtensions, array('doc', 'xls'));

To access the upload page, add this string on the url:


For example:

If you want some advanced configurations on file uploads such as setting upload size limit, file types, etc, you can find it on their media wiki's website.

No comments:

Post a Comment