5 * Created on Aug 21, 2008
7 * Copyright © 2008 - 2010 Bryan Tong Minh <Bryan.TongMinh@Gmail.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * http://www.gnu.org/copyleft/gpl.html
30 class ApiUpload
extends ApiBase
{
35 protected $mUpload = null;
39 public function __construct( $main, $action ) {
40 parent
::__construct( $main, $action );
43 public function execute() {
44 // Check whether upload is enabled
45 if ( !UploadBase
::isEnabled() ) {
46 $this->dieUsageMsg( 'uploaddisabled' );
49 $user = $this->getUser();
52 $this->mParams
= $this->extractRequestParams();
53 $request = $this->getMain()->getRequest();
54 // Add the uploaded file to the params array
55 $this->mParams
['file'] = $request->getFileName( 'file' );
56 $this->mParams
['chunk'] = $request->getFileName( 'chunk' );
58 // Copy the session key to the file key, for backward compatibility.
59 if( !$this->mParams
['filekey'] && $this->mParams
['sessionkey'] ) {
60 $this->mParams
['filekey'] = $this->mParams
['sessionkey'];
63 // Select an upload module
64 if ( !$this->selectUploadModule() ) {
65 // This is not a true upload, but a status request or similar
68 if ( !isset( $this->mUpload
) ) {
69 $this->dieUsage( 'No upload module set', 'nomodule' );
72 // First check permission to upload
73 $this->checkPermissions( $user );
76 $status = $this->mUpload
->fetchFile();
77 if ( !$status->isGood() ) {
78 $errors = $status->getErrorsArray();
79 $error = array_shift( $errors[0] );
80 $this->dieUsage( 'Error fetching file from remote source', $error, 0, $errors[0] );
83 // Check if the uploaded file is sane
84 if ( $this->mParams
['chunk'] ) {
85 $maxSize = $this->mUpload
->getMaxUploadSize( );
86 if( $this->mParams
['filesize'] > $maxSize ) {
87 $this->dieUsage( 'The file you submitted was too large', 'file-too-large' );
89 if ( !$this->mUpload
->getTitle() ) {
90 $this->dieUsage( 'Invalid file title supplied', 'internal-error' );
93 $this->verifyUpload();
96 // Check if the user has the rights to modify or overwrite the requested title
97 // (This check is irrelevant if stashing is already requested, since the errors
98 // can always be fixed by changing the title)
99 if ( ! $this->mParams
['stash'] ) {
100 $permErrors = $this->mUpload
->verifyTitlePermissions( $user );
101 if ( $permErrors !== true ) {
102 $this->dieRecoverableError( $permErrors[0], 'filename' );
105 // Get the result based on the current upload context:
106 $result = $this->getContextResult();
108 if ( $result['result'] === 'Success' ) {
109 $result['imageinfo'] = $this->mUpload
->getImageInfo( $this->getResult() );
112 $this->getResult()->addValue( null, $this->getModuleName(), $result );
114 // Cleanup any temporary mess
115 $this->mUpload
->cleanupTempFile();
119 * Get an uplaod result based on upload context
122 private function getContextResult(){
123 $warnings = $this->getApiWarnings();
124 if ( $warnings && !$this->mParams
['ignorewarnings'] ) {
125 // Get warnings formated in result array format
126 return $this->getWarningsResult( $warnings );
127 } elseif ( $this->mParams
['chunk'] ) {
128 // Add chunk, and get result
129 return $this->getChunkResult( $warnings );
130 } elseif ( $this->mParams
['stash'] ) {
131 // Stash the file and get stash result
132 return $this->getStashResult( $warnings );
134 // This is the most common case -- a normal upload with no warnings
135 // performUpload will return a formatted properly for the API with status
136 return $this->performUpload( $warnings );
139 * Get Stash Result, throws an expetion if the file could not be stashed.
140 * @param $warnings array Array of Api upload warnings
143 private function getStashResult( $warnings ){
145 // Some uploads can request they be stashed, so as not to publish them immediately.
146 // In this case, a failure to stash ought to be fatal
148 $result['result'] = 'Success';
149 $result['filekey'] = $this->performStash();
150 $result['sessionkey'] = $result['filekey']; // backwards compatibility
151 if ( $warnings && count( $warnings ) > 0 ) {
152 $result['warnings'] = $warnings;
154 } catch ( MWException
$e ) {
155 $this->dieUsage( $e->getMessage(), 'stashfailed' );
160 * Get Warnings Result
161 * @param $warnings array Array of Api upload warnings
164 private function getWarningsResult( $warnings ){
166 $result['result'] = 'Warning';
167 $result['warnings'] = $warnings;
168 // in case the warnings can be fixed with some further user action, let's stash this upload
169 // and return a key they can use to restart it
171 $result['filekey'] = $this->performStash();
172 $result['sessionkey'] = $result['filekey']; // backwards compatibility
173 } catch ( MWException
$e ) {
174 $result['warnings']['stashfailed'] = $e->getMessage();
179 * Get the result of a chunk upload.
180 * @param $warnings array Array of Api upload warnings
183 private function getChunkResult( $warnings ) {
188 $result['result'] = 'Continue';
189 if ( $warnings && count( $warnings ) > 0 ) {
190 $result['warnings'] = $warnings;
192 $request = $this->getMain()->getRequest();
193 $chunkPath = $request->getFileTempname( 'chunk' );
194 $chunkSize = $request->getUpload( 'chunk' )->getSize();
195 if ($this->mParams
['offset'] == 0) {
196 $result['filekey'] = $this->performStash();
198 $status = $this->mUpload
->addChunk(
199 $chunkPath, $chunkSize, $this->mParams
['offset'] );
200 if ( !$status->isGood() ) {
201 $this->dieUsage( $status->getWikiText(), 'stashfailed' );
205 // Check we added the last chunk:
206 if( $this->mParams
['offset'] +
$chunkSize == $this->mParams
['filesize'] ) {
207 if ( $this->mParams
['async'] && !wfIsWindows() ) {
208 $progress = UploadBase
::getSessionStatus( $this->mParams
['filekey'] );
209 if ( $progress && $progress['result'] !== 'Failed' ) {
210 $this->dieUsage( "Chunk assembly already in progress.", 'stashfailed' );
212 UploadBase
::setSessionStatus(
213 $this->mParams
['filekey'],
214 array( 'result' => 'Poll',
215 'stage' => 'queued', 'status' => Status
::newGood() )
218 $cmd = wfShellWikiCmd(
219 "$IP/includes/upload/AssembleUploadChunks.php",
221 '--wiki', wfWikiID(),
222 '--filename', $this->mParams
['filename'],
223 '--filekey', $this->mParams
['filekey'],
224 '--userid', $this->getUser()->getId(),
225 '--sessionid', session_id(),
228 ) . " < " . wfGetNull() . " > " . wfGetNull() . " 2>&1 &";
229 // Start a process in the background. Enforce the time limits via PHP
230 // since ulimit4.sh seems to often not work for this particular usage.
231 wfShellExec( $cmd, $retVal, array(), array( 'time' => 0, 'memory' => 0 ) );
232 if ( $retVal == 0 ) {
233 $result['result'] = 'Poll';
235 UploadBase
::setSessionStatus( $this->mParams
['filekey'], false );
237 "Failed to start AssembleUploadChunks.php", 'stashfailed' );
240 $status = $this->mUpload
->concatenateChunks();
241 if ( !$status->isGood() ) {
242 $this->dieUsage( $status->getWikiText(), 'stashfailed' );
246 // We have a new filekey for the fully concatenated file.
247 $result['filekey'] = $this->mUpload
->getLocalFile()->getFileKey();
249 // Remove chunk from stash. (Checks against user ownership of chunks.)
250 $this->mUpload
->stash
->removeFile( $this->mParams
['filekey'] );
252 $result['result'] = 'Success';
255 // Continue passing through the filekey for adding further chunks.
256 $result['filekey'] = $this->mParams
['filekey'];
259 $result['offset'] = $this->mParams
['offset'] +
$chunkSize;
264 * Stash the file and return the file key
265 * Also re-raises exceptions with slightly more informative message strings (useful for API)
266 * @throws MWException
267 * @return String file key
269 function performStash() {
271 $stashFile = $this->mUpload
->stashFile();
274 throw new MWException( 'Invalid stashed file' );
276 $fileKey = $stashFile->getFileKey();
277 } catch ( MWException
$e ) {
278 $message = 'Stashing temporary file failed: ' . get_class( $e ) . ' ' . $e->getMessage();
279 wfDebug( __METHOD__
. ' ' . $message . "\n");
280 throw new MWException( $message );
286 * Throw an error that the user can recover from by providing a better
287 * value for $parameter
289 * @param $error array Error array suitable for passing to dieUsageMsg()
290 * @param $parameter string Parameter that needs revising
291 * @param $data array Optional extra data to pass to the user
292 * @throws UsageException
294 function dieRecoverableError( $error, $parameter, $data = array() ) {
296 $data['filekey'] = $this->performStash();
297 $data['sessionkey'] = $data['filekey'];
298 } catch ( MWException
$e ) {
299 $data['stashfailed'] = $e->getMessage();
301 $data['invalidparameter'] = $parameter;
303 $parsed = $this->parseMsg( $error );
304 $this->dieUsage( $parsed['info'], $parsed['code'], 0, $data );
308 * Select an upload module and set it to mUpload. Dies on failure. If the
309 * request was a status request and not a true upload, returns false;
314 protected function selectUploadModule() {
315 $request = $this->getMain()->getRequest();
317 // chunk or one and only one of the following parameters is needed
318 if ( !$this->mParams
['chunk'] ) {
319 $this->requireOnlyOneParameter( $this->mParams
,
320 'filekey', 'file', 'url', 'statuskey' );
323 if ( $this->mParams
['filekey'] && $this->mParams
['checkstatus'] ) {
324 $progress = UploadBase
::getSessionStatus( $this->mParams
['filekey'] );
326 $this->dieUsage( 'No result in status data', 'missingresult' );
327 } elseif ( !$progress['status']->isGood() ) {
328 $this->dieUsage( $progress['status']->getWikiText(), 'stashfailed' );
330 unset( $progress['status'] ); // remove Status object
331 $this->getResult()->addValue( null, $this->getModuleName(), $progress );
335 if ( $this->mParams
['statuskey'] ) {
336 $this->checkAsyncDownloadEnabled();
338 // Status request for an async upload
339 $sessionData = UploadFromUrlJob
::getSessionData( $this->mParams
['statuskey'] );
340 if ( !isset( $sessionData['result'] ) ) {
341 $this->dieUsage( 'No result in session data', 'missingresult' );
343 if ( $sessionData['result'] == 'Warning' ) {
344 $sessionData['warnings'] = $this->transformWarnings( $sessionData['warnings'] );
345 $sessionData['sessionkey'] = $this->mParams
['statuskey'];
347 $this->getResult()->addValue( null, $this->getModuleName(), $sessionData );
351 // The following modules all require the filename parameter to be set
352 if ( is_null( $this->mParams
['filename'] ) ) {
353 $this->dieUsageMsg( array( 'missingparam', 'filename' ) );
356 if ( $this->mParams
['chunk'] ) {
358 $this->mUpload
= new UploadFromChunks();
359 if( isset( $this->mParams
['filekey'] ) ){
361 $this->mUpload
->continueChunks(
362 $this->mParams
['filename'],
363 $this->mParams
['filekey'],
364 $request->getUpload( 'chunk' )
367 // handle first chunk
368 $this->mUpload
->initialize(
369 $this->mParams
['filename'],
370 $request->getUpload( 'chunk' )
373 } elseif ( isset( $this->mParams
['filekey'] ) ) {
374 // Upload stashed in a previous request
375 if ( !UploadFromStash
::isValidKey( $this->mParams
['filekey'] ) ) {
376 $this->dieUsageMsg( 'invalid-file-key' );
379 $this->mUpload
= new UploadFromStash( $this->getUser() );
381 $this->mUpload
->initialize( $this->mParams
['filekey'], $this->mParams
['filename'] );
382 } elseif ( isset( $this->mParams
['file'] ) ) {
383 $this->mUpload
= new UploadFromFile();
384 $this->mUpload
->initialize(
385 $this->mParams
['filename'],
386 $request->getUpload( 'file' )
388 } elseif ( isset( $this->mParams
['url'] ) ) {
389 // Make sure upload by URL is enabled:
390 if ( !UploadFromUrl
::isEnabled() ) {
391 $this->dieUsageMsg( 'copyuploaddisabled' );
394 if ( !UploadFromUrl
::isAllowedHost( $this->mParams
['url'] ) ) {
395 $this->dieUsageMsg( 'copyuploadbaddomain' );
399 if ( $this->mParams
['asyncdownload'] ) {
400 $this->checkAsyncDownloadEnabled();
402 if ( $this->mParams
['leavemessage'] && !$this->mParams
['ignorewarnings'] ) {
403 $this->dieUsage( 'Using leavemessage without ignorewarnings is not supported',
404 'missing-ignorewarnings' );
407 if ( $this->mParams
['leavemessage'] ) {
408 $async = 'async-leavemessage';
413 $this->mUpload
= new UploadFromUrl
;
414 $this->mUpload
->initialize( $this->mParams
['filename'],
415 $this->mParams
['url'], $async );
422 * Checks that the user has permissions to perform this upload.
423 * Dies with usage message on inadequate permissions.
424 * @param $user User The user to check.
426 protected function checkPermissions( $user ) {
427 // Check whether the user has the appropriate permissions to upload anyway
428 $permission = $this->mUpload
->isAllowed( $user );
430 if ( $permission !== true ) {
431 if ( !$user->isLoggedIn() ) {
432 $this->dieUsageMsg( array( 'mustbeloggedin', 'upload' ) );
434 $this->dieUsageMsg( 'badaccess-groups' );
440 * Performs file verification, dies on error.
442 protected function verifyUpload( ) {
443 global $wgFileExtensions;
445 $verification = $this->mUpload
->verifyUpload( );
446 if ( $verification['status'] === UploadBase
::OK
) {
450 // TODO: Move them to ApiBase's message map
451 switch( $verification['status'] ) {
452 // Recoverable errors
453 case UploadBase
::MIN_LENGTH_PARTNAME
:
454 $this->dieRecoverableError( 'filename-tooshort', 'filename' );
456 case UploadBase
::ILLEGAL_FILENAME
:
457 $this->dieRecoverableError( 'illegal-filename', 'filename',
458 array( 'filename' => $verification['filtered'] ) );
460 case UploadBase
::FILENAME_TOO_LONG
:
461 $this->dieRecoverableError( 'filename-toolong', 'filename' );
463 case UploadBase
::FILETYPE_MISSING
:
464 $this->dieRecoverableError( 'filetype-missing', 'filename' );
466 case UploadBase
::WINDOWS_NONASCII_FILENAME
:
467 $this->dieRecoverableError( 'windows-nonascii-filename', 'filename' );
470 // Unrecoverable errors
471 case UploadBase
::EMPTY_FILE
:
472 $this->dieUsage( 'The file you submitted was empty', 'empty-file' );
474 case UploadBase
::FILE_TOO_LARGE
:
475 $this->dieUsage( 'The file you submitted was too large', 'file-too-large' );
478 case UploadBase
::FILETYPE_BADTYPE
:
480 'filetype' => $verification['finalExt'],
481 'allowed' => $wgFileExtensions
483 $this->getResult()->setIndexedTagName( $extradata['allowed'], 'ext' );
485 $msg = "Filetype not permitted: ";
486 if ( isset( $verification['blacklistedExt'] ) ) {
487 $msg .= join( ', ', $verification['blacklistedExt'] );
488 $extradata['blacklisted'] = array_values( $verification['blacklistedExt'] );
489 $this->getResult()->setIndexedTagName( $extradata['blacklisted'], 'ext' );
491 $msg .= $verification['finalExt'];
493 $this->dieUsage( $msg, 'filetype-banned', 0, $extradata );
495 case UploadBase
::VERIFICATION_ERROR
:
496 $this->getResult()->setIndexedTagName( $verification['details'], 'detail' );
497 $this->dieUsage( 'This file did not pass file verification', 'verification-error',
498 0, array( 'details' => $verification['details'] ) );
500 case UploadBase
::HOOK_ABORTED
:
501 $this->dieUsage( "The modification you tried to make was aborted by an extension hook",
502 'hookaborted', 0, array( 'error' => $verification['error'] ) );
505 $this->dieUsage( 'An unknown error occurred', 'unknown-error',
506 0, array( 'code' => $verification['status'] ) );
514 * Returns a suitable array for inclusion into API results if there were warnings
515 * Returns the empty array if there were no warnings
519 protected function getApiWarnings() {
520 $warnings = $this->mUpload
->checkWarnings();
522 return $this->transformWarnings( $warnings );
525 protected function transformWarnings( $warnings ) {
528 $result = $this->getResult();
529 $result->setIndexedTagName( $warnings, 'warning' );
531 if ( isset( $warnings['duplicate'] ) ) {
533 foreach ( $warnings['duplicate'] as $dupe ) {
534 $dupes[] = $dupe->getName();
536 $result->setIndexedTagName( $dupes, 'duplicate' );
537 $warnings['duplicate'] = $dupes;
540 if ( isset( $warnings['exists'] ) ) {
541 $warning = $warnings['exists'];
542 unset( $warnings['exists'] );
543 $warnings[$warning['warning']] = $warning['file']->getName();
551 * Perform the actual upload. Returns a suitable result array on success;
554 * @param $warnings array Array of Api upload warnings
557 protected function performUpload( $warnings ) {
558 // Use comment as initial page text by default
559 if ( is_null( $this->mParams
['text'] ) ) {
560 $this->mParams
['text'] = $this->mParams
['comment'];
563 $file = $this->mUpload
->getLocalFile();
564 $watch = $this->getWatchlistValue( $this->mParams
['watchlist'], $file->getTitle() );
566 // Deprecated parameters
567 if ( $this->mParams
['watch'] ) {
571 // No errors, no warnings: do the upload
572 $status = $this->mUpload
->performUpload( $this->mParams
['comment'],
573 $this->mParams
['text'], $watch, $this->getUser() );
575 if ( !$status->isGood() ) {
576 $error = $status->getErrorsArray();
578 if ( count( $error ) == 1 && $error[0][0] == 'async' ) {
579 // The upload can not be performed right now, because the user
582 'result' => 'Queued',
583 'statuskey' => $error[0][1],
586 $this->getResult()->setIndexedTagName( $error, 'error' );
588 $this->dieUsage( 'An internal error occurred', 'internal-error', 0, $error );
592 $file = $this->mUpload
->getLocalFile();
594 $result['result'] = 'Success';
595 $result['filename'] = $file->getName();
596 if ( $warnings && count( $warnings ) > 0 ) {
597 $result['warnings'] = $warnings;
604 * Checks if asynchronous copy uploads are enabled and throws an error if they are not.
606 protected function checkAsyncDownloadEnabled() {
607 global $wgAllowAsyncCopyUploads;
608 if ( !$wgAllowAsyncCopyUploads ) {
609 $this->dieUsage( 'Asynchronous copy uploads disabled', 'asynccopyuploaddisabled');
613 public function mustBePosted() {
617 public function isWriteMode() {
621 public function getAllowedParams() {
624 ApiBase
::PARAM_TYPE
=> 'string',
627 ApiBase
::PARAM_DFLT
=> ''
631 ApiBase
::PARAM_TYPE
=> 'string',
632 ApiBase
::PARAM_REQUIRED
=> true
635 ApiBase
::PARAM_DFLT
=> false,
636 ApiBase
::PARAM_DEPRECATED
=> true,
638 'watchlist' => array(
639 ApiBase
::PARAM_DFLT
=> 'preferences',
640 ApiBase
::PARAM_TYPE
=> array(
646 'ignorewarnings' => false,
650 'sessionkey' => array(
651 ApiBase
::PARAM_DFLT
=> null,
652 ApiBase
::PARAM_DEPRECATED
=> true,
661 'asyncdownload' => false,
662 'leavemessage' => false,
664 'checkstatus' => false,
670 public function getParamDescription() {
672 'filename' => 'Target filename',
673 'token' => 'Edit token. You can get one of these through prop=info',
674 'comment' => 'Upload comment. Also used as the initial page text for new files if "text" is not specified',
675 'text' => 'Initial page text for new files',
676 'watch' => 'Watch the page',
677 'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch',
678 'ignorewarnings' => 'Ignore any warnings',
679 'file' => 'File contents',
680 'url' => 'URL to fetch the file from',
681 'filekey' => 'Key that identifies a previous upload that was stashed temporarily.',
682 'sessionkey' => 'Same as filekey, maintained for backward compatibility.',
683 'stash' => 'If set, the server will not add the file to the repository and stash it temporarily.',
685 'chunk' => 'Chunk contents',
686 'offset' => 'Offset of chunk in bytes',
687 'filesize' => 'Filesize of entire upload',
689 'async' => 'Make potentially large file operations asynchronous when possible',
690 'asyncdownload' => 'Make fetching a URL asynchronous',
691 'leavemessage' => 'If asyncdownload is used, leave a message on the user talk page if finished',
692 'statuskey' => 'Fetch the upload status for this file key (upload by URL)',
693 'checkstatus' => 'Only fetch the upload status for the given file key',
700 public function getResultProperties() {
704 ApiBase
::PROP_TYPE
=> array(
712 ApiBase
::PROP_TYPE
=> 'string',
713 ApiBase
::PROP_NULLABLE
=> true
715 'sessionkey' => array(
716 ApiBase
::PROP_TYPE
=> 'string',
717 ApiBase
::PROP_NULLABLE
=> true
720 ApiBase
::PROP_TYPE
=> 'integer',
721 ApiBase
::PROP_NULLABLE
=> true
723 'statuskey' => array(
724 ApiBase
::PROP_TYPE
=> 'string',
725 ApiBase
::PROP_NULLABLE
=> true
728 ApiBase
::PROP_TYPE
=> 'string',
729 ApiBase
::PROP_NULLABLE
=> true
735 public function getDescription() {
737 'Upload a file, or get the status of pending uploads. Several methods are available:',
738 ' * Upload file contents directly, using the "file" parameter',
739 ' * Have the MediaWiki server fetch a file from a URL, using the "url" parameter',
740 ' * Complete an earlier upload that failed due to warnings, using the "filekey" parameter',
741 'Note that the HTTP POST must be done as a file upload (i.e. using multipart/form-data) when',
742 'sending the "file". Also you must get and send an edit token before doing any upload stuff'
746 public function getPossibleErrors() {
747 return array_merge( parent
::getPossibleErrors(),
748 $this->getRequireOnlyOneParameterErrorMessages( array( 'filekey', 'file', 'url', 'statuskey' ) ),
750 array( 'uploaddisabled' ),
751 array( 'invalid-file-key' ),
752 array( 'uploaddisabled' ),
753 array( 'mustbeloggedin', 'upload' ),
754 array( 'badaccess-groups' ),
755 array( 'code' => 'fetchfileerror', 'info' => '' ),
756 array( 'code' => 'nomodule', 'info' => 'No upload module set' ),
757 array( 'code' => 'empty-file', 'info' => 'The file you submitted was empty' ),
758 array( 'code' => 'filetype-missing', 'info' => 'The file is missing an extension' ),
759 array( 'code' => 'filename-tooshort', 'info' => 'The filename is too short' ),
760 array( 'code' => 'overwrite', 'info' => 'Overwriting an existing file is not allowed' ),
761 array( 'code' => 'stashfailed', 'info' => 'Stashing temporary file failed' ),
762 array( 'code' => 'internal-error', 'info' => 'An internal error occurred' ),
763 array( 'code' => 'asynccopyuploaddisabled', 'info' => 'Asynchronous copy uploads disabled' ),
764 array( 'fileexists-forbidden' ),
765 array( 'fileexists-shared-forbidden' ),
770 public function needsToken() {
774 public function getTokenSalt() {
778 public function getExamples() {
780 'api.php?action=upload&filename=Wiki.png&url=http%3A//upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png'
781 => 'Upload from a URL',
782 'api.php?action=upload&filename=Wiki.png&filekey=filekey&ignorewarnings=1'
783 => 'Complete an upload that failed due to warnings',
787 public function getHelpUrls() {
788 return 'https://www.mediawiki.org/wiki/API:Upload';
791 public function getVersion() {
792 return __CLASS__
. ': $Id$';