Fix for chunked uploading support in API.
authorErik Moeller <erik@wikimedia.org>
Sun, 8 Apr 2012 11:27:32 +0000 (04:27 -0700)
committerErik Moeller <erik@wikimedia.org>
Mon, 9 Apr 2012 03:27:02 +0000 (20:27 -0700)
commit631519fde77e1c630c785d4b89d36986857d12e2
tree72472f064ecd8902e22f451a827b6a62bb387097
parente1dd00327e5d169a0299f2502fa9215786903389
Fix for chunked uploading support in API.

Chunked uploading is currently only implemented by Upload Wizard,
but is supported in MediaWiki core. It's enabled in Upload Wizard
by setting $wgUploadWizardConfig['enableChunked'] to true.

When enabled, large files will be split into smaller chunks, by
default of 1 MB. This is done through a series of API POST
requests. The file is identified by means of a 'filekey' to
allow for continuation of uploads from previous offsets.

Previously broken behavior: Files were concatenated correctly,
but instead of the whole file, one of the chunks was uploaded
to the wiki. This was due to the API using the filekey of the
chunk, as opposed to the filekey of the whole file.

In addition, this change also cleans out the stash information
for both filekeys after the upload is complete.

[Patch set 2: Whitespace fix]
[Patch set 3: Move filekey result past status check]

Change-Id: Idac94e953676787f9516051e47c006525f198fd4
includes/api/ApiUpload.php