MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

Documentation and examples: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page

action=upload-to-commons

(main | upload-to-commons)
  • This module requires read rights.
  • This module requires write rights.
  • This module only accepts POST requests.
  • Source: Upload2Commons
  • License: GPL-2.0+

Upload a local wiki file to a remote wiki using OAuth.

The file must already be uploaded on the local wiki. Several methods are available:

  • Upload from an on-wiki file, using the localfilename parameter.
  • Upload from a stashed file, using the filekey parameter.

Note that the filename, comment, tags, text and ignorewarnings parameters are the same than in action=upload.

Parameters:
localfilename

Name of a file to upload (without the "File:" namespace).

filekey

Filekey of a stashed file to upload.

filename

Target filename.

comment

Upload comment.

tags

Change tags to apply to the upload log entry and file page revision on the remote wiki.

Separate values with | or alternative.
Maximum number of values is 50 (500 for clients allowed higher limits).
text

Initial page text for new files. If not specified, the page text of the local file will be used instead.

ignorewarnings

Ignore any warnings on the remote wiki.

Type: boolean (details)
removeafterupload

Remove the stashed file if the upload succeeded (doesn't delete any already on-wiki files, see action=delete for that).

Type: boolean (details)
logtags

Set custom tags to the remoteupload log entry.

Values (separate with | or alternative): manual-remote-upload, record-wizard
token

A "csrf" token retrieved from action=query&meta=tokens

This parameter is required.