- $_SESSION[UploadBase::getSessionKey()][$this->mParams['sessionkey']] );
- } elseif ( isset( $this->mParams['filename'] ) ) {
- /**
- * Upload from URL, etc.
- * Parameter filename is required
- */
- if ( isset( $this->mParams['file'] ) ) {
- $this->mUpload = new UploadFromFile();
- $this->mUpload->initialize(
- $this->mParams['filename'],
- $request->getFileTempName( 'file' ),
- $request->getFileSize( 'file' )
- );
- } elseif ( isset( $this->mParams['url'] ) ) {
- // make sure upload by URL is enabled:
- if ( !$wgAllowCopyUploads ) {
- $this->dieUsageMsg( array( 'copyuploaddisabled' ) );
- }
-
- // make sure the current user can upload
- if ( !$wgUser->isAllowed( 'upload_by_url' ) ) {
- $this->dieUsageMsg( array( 'badaccess-groups' ) );
- }
-
- $this->mUpload = new UploadFromUrl;
- $async = $this->mParams['asyncdownload'] ? 'async' : null;
-
- $result = $this->mUpload->initialize( $this->mParams['filename'],
- $this->mParams['url'],
- $this->mParams['comment'],
- $this->mParams['watchlist'],
- $this->mParams['ignorewarnings'],
- $async );
-
- $this->checkPermissions( $wgUser );
- if ( $async ) {
- $this->getResult()->addValue( null,
- $this->getModuleName(),
- array( 'queued' => $result ) );
- return;
- }
-
- $status = $this->mUpload->retrieveFileFromUrl();
- if ( !$status->isGood() ) {
- $this->getResult()->addValue( null,
- $this->getModuleName(),
- array( 'error' => $status ) );
- return;
+ $sessionData[$this->mParams['sessionkey']] );
+
+
+ } elseif ( isset( $this->mParams['file'] ) ) {
+ $this->mUpload = new UploadFromFile();
+ $this->mUpload->initialize(
+ $this->mParams['filename'],
+ $request->getUpload( 'file' )
+ );
+ } elseif ( isset( $this->mParams['url'] ) ) {
+ // Make sure upload by URL is enabled:
+ if ( !UploadFromUrl::isEnabled() ) {
+ $this->dieUsageMsg( array( 'copyuploaddisabled' ) );
+ }
+
+ $async = false;
+ if ( $this->mParams['asyncdownload'] ) {
+ if ( $this->mParams['leavemessage'] ) {
+ $async = 'async-leavemessage';
+ } else {
+ $async = 'async';