API:Edit - Uploading files

From MediaWiki.org

Jump to: navigation, search
This page is part of the MediaWiki API documentation.
MediaWiki API

[edit] Image/File Uploading

MediaWiki version: PROPOSED
Upload action allows to upload a file to MediaWiki Server. At this first stage, only image files can be uploaded, but it will be possible to extend the functionality to audio or video files. As in RegUser action, most parameters are passed via POST to protect sensible information and to allow higher size of information, specially for the file itself
api.php ? action=upload
Post parameters
Parameter name Value Default Comment
upfile <file_contents>
updestfile <filename>
upsummary <summary>
[ upwatch ] yes/no no
[ upignore ] yes/no no
[ uplicense ] <license>
[ upuserid ] <userid> Parameter identifying the logged user uploading the file
[ upusertoken ] <lgtoken> Parameter identifying the logged user uploading the file
<api>
  <upload result="SUCCESS" title="Ejemplo.jpg" ns="6" />
</api>
Personal tools