Extension:UploadLocal

From MediaWiki.org
(Redirected from Extension:SpecialUploadLocal)
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
UploadLocal

Release status: beta

Implementation Special page
Description Allows quick mass uploading of large files.
Author(s) Edward Z. Yang, Christian Neubauer
MediaWiki 1.7.+
Database changes no
License GPLv2+
Download MediaWiki 1.7 - 1.15: see here
MediaWiki 1.16+: Template:WikimediaDownload/gerritonly
Parameters

$wgUploadDirectory

Added rights

uploadlocal

Translate the UploadLocal extension if possible

Check usage and version matrix; code metrics

UploadLocal is an extension which allows the "uploading" of files already residing on the server into MediaWiki, by a special page on your mediawiki. This has numerous practical applications, notably the streamlining of the upload of large files, renaming of image files, and the ability to mass upload. Note that for this extension to be useful, the user must be able to put files in a directory accessible via the server's file system.

Note: An earlier version of this extension works for 1.15 and some MediaWiki versions prior to that. See the older version of this page for details.

Installation[edit | edit source]

  1. Download the files from Git or download a snapshot (select your version of MediaWiki) and place the files under $IP/extensions/UploadLocal
cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/UploadLocal.git

2. Set permissions for your web server to be able to write to extensions/UploadLocal/data ( or whatever you have $wgUploadLocalDirectory set to, see below).

3. Add to the end of LocalSettings.php:

require_once("$IP/extensions/UploadLocal/UploadLocal.php");

4. Installation can now be verified through Special:Version on your wiki

Optional settings[edit | edit source]

The default folder where the upload files are uploaded, is set by $wgUploadLocalDirectory, so you can set it to whatever you want. The default is:

$wgUploadLocalDirectory = $IP . '/extensions/UploadLocal/data';

Also, the extension adds a new right called uploadlocal and a new user group, uploader, along with sysop, are allowed to use this extension. You can change this however you want, although remember, in order for the extension to be useful, the user must also have FTP access.

Use[edit | edit source]

  1. Upload files (via FTP) into the directory /extensions/UploadLocal/data (or whatever folder you set $wgUploadLocal to). Note: folder recursion is not currently supported.
  2. Confirm that the currently logged in user has uploader permissions by checking Special:UserRights (failing to have the right permissions will get you a blank page when to do the next step)
  3. Then go to Special:UploadLocal and you should see the files you uploaded listed there. Specify any naming prepends, then click the upload button at the bottom of the page. You should see the full list of uploaded files then, and you can use them as you normally would an uploaded file.

Todo[edit | edit source]

  • Make the extension backwards compatible with 1.16. YesY Done
  • If uploads are disabled, the page does not have a page title.
  • Check for disallowed file extensions and show an appropriate error message. YesY Done
  • If a file is not allowed because it has a generic filename (DSC0001.jpg) the uploader reports that the file already exists which is the wrong error message. YesY Done
  • Show a thumbnail of the image on the upload form?

See also[edit | edit source]

  • ImportImages.php, MediaWiki native PHP import script
  • Commonist, a Java tool that makes it easy to upload large numbers of files using HTTP. This tool doesn't need another extension, but is Commons specific and slower.
  • Image File Migrator, a Python tool that can download files from one wiki and upload them to another.
  • Extension:MultiUpload