From: Mark A. Hershberger Date: Fri, 12 Feb 2010 06:28:03 +0000 (+0000) Subject: Final(?) changes to enable chunked uploading. X-Git-Tag: 1.31.0-rc.0~37803 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=57c2247c81cb14a5f23d081d0da75a61fadee7ca;p=lhc%2Fweb%2Fwiklou.git Final(?) changes to enable chunked uploading. --- diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index b83c7c7107..c995326d0c 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -138,8 +138,8 @@ class ApiUpload extends ApiBase { // Cleanup any temporary mess $this->mUpload->cleanupTempFile(); - if( $this->mParams['enablechunks'] ) { - foreach ($result as $key => $value) { + if( isset($result['chunked-output']) ) { + foreach ($result['chunked-output'] as $key => $value) { if($value === null) $value = ""; $this->getResult()->addValue( null, $key, $value ); } @@ -249,7 +249,7 @@ class ApiUpload extends ApiBase { $this->dieUsage( 'An internal error occurred', 'internal-error', 0, $error ); } elseif( $this->mParams['enablechunks'] ) { - return $status->value; + return array("chunked-output" => $status->value); } $file = $this->mUpload->getLocalFile(); @@ -279,7 +279,7 @@ class ApiUpload extends ApiBase { 'watch' => false, 'ignorewarnings' => false, 'file' => null, - 'enablechunks' => false, + 'enablechunks' => null, /* must be null to work with requireOnlyOneParameter */ 'chunksession' => null, 'chunk' => null, 'done' => false,