This page is a translated version of the page Extension:UploadWizard and the translation is 100% complete.
Manuel des extensions MediaWiki
OOjs UI icon advanced-invert.svg
État de la version : stable
Upload Wizard screenshot (release rights).png
Implémentation Média, Page spéciale
Description Assistant de téléchargement étape par étape multi-fichiers
Auteur(s) Neil Kandalgaonkar, Jeroen De Dauw, Mark Holmquist, Ryan Kaldari, Ankur Anand, Yuvi Panda, Michael Dale
Dernière version continuous updates
MediaWiki 1.27+
Modifie la base
de données
Tables uw_campaigns
Licence Licence publique générale GNU v2.0 ou supérieur
  • $wgUploadWizardConfig
  • upwizcampaigns
  • mass-upload
Traduire l’extension UploadWizard sur translatewiki.net si elle y est disponible

Vérifier la matrice des utilisations et des versions.

Rôle Vagrant uploadwizard
Problèmes Tâches ouvertes · Signaler un bogue

L'extension UploadWizard permet à un utilisateur de télécharger plusieurs fichiers avec un assistant JavaScript étape par étape.

Voir aussi : Page de description de l'assistant de téléchargement sur Wikimedia Commons


Activation des téléchargements et des miniatures

Votre MediaWiki devra être capable d'héberger des fichiers multimédias et de créer des miniatures (aperçus plus petits des fichiers multimédias). Si vous pouvez télécharger des images et voir des aperçus plus petits sur leur page File:, vous êtes déjà prêt. Sinon, pour des instructions complètes, voir Manuel:Gestion des images , en particulier image miniature.

Pour les utilisateurs de GNU/Linux ou Mac OS X
  • Assurez-vous que le répertoire images est accessible en écriture par votre serveur web.
  • Installer les bibliothèques ImageMagick et les binaires.
  • Télécharger et extraire les fichiers UploadWizard comme indiqué ci-après : Special:ExtensionDistributor/UploadWizard
  • Ajouter les paramètres suivants dans votre fichier LocalSettings.php :
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = <path to your convert command>;  # Only needs to be set if different from /usr/bin/convert

wfLoadExtension( 'UploadWizard' );

You also need to change the following core configuration variable.

// Needed to make UploadWizard work in IE, see https://phabricator.wikimedia.org/T41877
$wgApiFrameOptions = 'SAMEORIGIN';

You should also install the EventLogging extension. This is used only if you use the campaigns feature, and should be made a soft dependency at some point in the future.

Activation des téléchargements Flickr

You can also use UploadWizard to transfer files directly from Flickr. To enable this option, first you'll need to get an API key from Flickr:

  1. Log in to Flickr;
  2. Go to the Apps By You page in the Flickr App Garden;
  3. Click on 'Get another key';
  4. Choose 'Apply for a non-commercial key';
  5. Enter a name and a description and check the two waiver checkboxes before submitting.

Once you have a key, add the following to your LocalSettings.php:

$wgAllowCopyUploads = true;
$wgGroupPermissions['user']['upload_by_url'] = true; // to allow for all registered users

$wgUploadWizardConfig = [
    'flickrApiUrl' => 'https://api.flickr.com/services/rest/?',
    'flickrApiKey' => 'XXXXXXXXXXXXXXX',

You may also want to limit the upload domains specifically to Flickr:

$wgCopyUploadsDomains = [ '*.flickr.com', '*.staticflickr.com' ];

Updating from versions before 07/2013

The following is essentially important if you made use of the Campaign feature:

  • Update MediaWiki core to version 1.22 or later
  • Check your custom configuration (LocalSettings.php ) against the new default config. Parameters like automatically added categories changed (autoCategoriesautoAdd => array( categories ).
  • Install Extension:EventLogging .
  • Run
    $ php extensions/UploadWizard/maintenance/migrateCampaigns.php

Autre configuration

  • You need to have InstantCommons enabled in order to access the licensing tutorial. To enable InstantCommons add
    $wgUseInstantCommons = true;
    to LocalSettings.php .
  • You may want to set
    $wgUploadNavigationUrl = '/wiki/Special:UploadWizard';
    in LocalSettings.php, where /wiki/ is the correct path for your wiki. A more general way of doing this that works for whatever path configuration you have, but that requires PHP 5.3 or later is:
$wgExtensionFunctions[] = function() {
	$GLOBALS['wgUploadNavigationUrl'] = SpecialPage::getTitleFor( 'UploadWizard' )->getLocalURL();
	return true;

This modifies the sidebar's "Upload file" link - probably in other places as well. More at Manuel:$wgUploadNavigationUrl .

Several other options are available through a configuration array. For example:

$wgUploadWizardConfig = array(
	'debug' => false,
	'autoAdd' => array(
	 	'wikitext' => array(
			'This file was uploaded with the UploadWizard extension.'
	 	'categories' => array(
	 		 'Uploaded with UploadWizard'	
		), // Should be localised to the language of your wiki instance
	'feedbackPage' => 'Feedback about UploadWizard',
	'altUploadForm' => 'Special:Upload',
	'feedbackLink' => false, // Disable the link for feedback (default: points to Commons)
	'alternativeUploadToolsPage' => false, // Disable the link to alternative upload tools (default: points to Commons)
	'enableFormData' => true, // Enable FileAPI uploads be used on supported browsers
	'enableMultipleFiles' => true,
	'enableMultiFileSelect' => false,
	'uwLanguages' => array(
		'ar' => 'العربية',
		'de' => 'Deutsch',
		'en' => 'English'
		), // Selectable languages for file descriptions - defaults to 'en'
	'tutorial' => array(
	 	'skip' => true
		), // Skip the tutorial
	'maxUploads' => 15, // Number of uploads with one form - defaults to 50
	'fileExtensions' => $wgFileExtensions // omitting this may cause errors

Utilisation dans des environnements sans licence

If you are installing UploadWizard in an environment where licenses are not used, you may want to add the configuration below to LocalSettings.php. This will limit the license choices to a single default that references the wiki's generic disclaimer. Note that there are many other configuration settings to add depending on your use case.

$wgUploadWizardConfig = array(
    'licensing' => array(
        'ownWorkDefault' => 'own',
        'ownWork' => array(
            'type' => 'or',
            'template' => 'licensing', // this adds a link to Template:Licensing to the file info page
            'licenses' => array(

These are just some sample settings. See the "UploadWizard.config.php" file (starting around line 80) for many more options supported in the $wgUploadWizardConfig array.

Modification des messages génériques de l'interface utilisateur

If you wish to modify the generic messages, you can do so within the wiki itself editing the following pages:

  • MediaWiki:Mwe-upwiz-source-ownwork
  • MediaWiki:Mwe-upwiz-source-ownwork-assert-generic
  • MediaWiki:Mwe-upwiz-source-ownwork-generic-explain


Arguments de l'URL

There are several URL arguments that can be specified to alter the behaviour of the UploadWizard:

  • campaign: Specifies which upload campaign to use.
  • description: Sets the initial value for the description field.
  • lat: Sets the initial value for the latitude field.
  • lon: Sets the initial value for the longitude field.
  • alt: Sets the initial value for the altitude field.
  • categories: Sets the initial value for the categories field, multiple categories separated by |.
  • fields[]: The initial values of additional fields defined by a campaign. Values of multiple fields must be passed in the exact same order as defined in the campaign.
(e. g. fields[]=value_first&fields[]=value_second)
  • objref: Specifies an object reference that can be used to update a page with a thumbnail of an uploaded image. See #Object references for further details.
  • updateList: Specifies whether a list page should be updated at all. This parameter only works in combination with objref. See #Object references for further details.

These arguments can be specified as follows: if you have an argument named "campaign" and want to provide the value "foobar", then append campaign=foobar to the url. For example wiki/Special:UploadWizard?campaign=foobar or w/index.php?title=Special:UploadWizard&campaign=foobar.

The following URL arguments are still supported for existing URLs, but deprecated:

  • id: If specified, this value is used instead of the first fields[] value. Please use fields[] instead.
  • id2: If specified, this value is used instead of the second fields[] value. Please use fields[] instead.

Références des objets

Upload Wizard provides a way to store “object references” - references to list templates in Wiki pages - in the file description page. These may be used by bots to insert a thumbnail image into a list page. A bot that is doing this for monument lists of German Wikipedia is running on tool labs. Its code is hosted on GitHub. Though its purpose is to update monument lists on Wikipedia it can be adopted to serve in different scenarios.

This feature uses the parameters objref and updateList. If both parameters are passed, the Upload Wizard shows a checkbox for each upload, which can be used to select the image that the object reference is added to. If the parameter updateList is omitted, the checkboxes will be disabled and an additional notice is being displayed stating that an image for the object already exists in the list.

  • objref: Specifies an object reference that can be used to update a page with a thumbnail of an uploaded image. Passing this parameter is expected in the following format objref=prefix|page_title|object_id
    • prefix - Interwiki or interlanguage prefix as defined per Special:Interwiki. The prefix must be defined in order to make this work.
    • page_title - The title of the page the object is listed on.
    • object_id - A unique identifier of the object for a bot to update
  • updateList: Specifies whether a list page should be updated at all. Set to any value, this parameter enables a checkbox


If you're testing UploadWizard for whatever reason, and you've run out of "real" images to upload as test cases, you can always use the handy MediaWiki utility for creating test images. Open a terminal emulator, get into a directory where you want to store a bunch of test JPG files, and run

$ php path/to/mediawiki/tests/phpunit/includes/api/generateRandomImages.php

Here's a Bash script that should make it easier to do all of this without much trouble. It's a good idea to put this in your PATH and/or make a handy shortcut to it somewhere that will make it trivial to update your images with new ones.


# Declare some paths (easier to configure)

# Get to the pic path, and remove old test images
rm *.jpg

# Run the generate script three times to give us a bunch of images
php $MW_INSTALL_PATH/tests/phpunit/includes/api/generateRandomImages.php
php $MW_INSTALL_PATH/tests/phpunit/includes/api/generateRandomImages.php
php $MW_INSTALL_PATH/tests/phpunit/includes/api/generateRandomImages.php


  Avertissement : This list is not complete and more templates are required, otherwise you will end with SCRIPT error or other error messages not in English!

Upload Wizard will insert a few templates into generated file description pages, which need to exist on the wiki in order for the description pages to be rendered correctly. The templates used include:

Statut du développement

While we feel that this is ready for others to use, so far, this extension has mostly been used only on Wikimedia wikis. We'd like to get reports from other MediaWiki installations as well.


Extension:UploadWizard was originally designed by Guillaume Paumier as part of the Multimedia usability project and developed by Neil Kandalgaonkar, and has evolved since then.

Voir aussi

Spécifications associées