Page MenuHomePhabricator

UploadWizard: Resumable uploads
Closed, ResolvedPublic

Description

Author: neilk

Description:
Allow for an chunked uploading protocol similar to Google's Resumable Media Upload protocol:

http://code.google.com/apis/gdata/docs/resumable_upload.html

This will have the benefit of making uploads resistant to intermittent connection drops, and will also make it possible to have progress bars without Flash (bug 24759)


Version: unspecified
Severity: enhancement

Details

Reference
bz29250

Related Objects

StatusSubtypeAssignedTask
ResolvedNone
ResolvedNone
ResolvedNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:37 PM
bzimport added a project: UploadWizard.
bzimport set Reference to bz29250.
bzimport added a subscriber: Unknown Object (MLST).

mdale wrote:

Resumable uploads is supported in trunk uploadWizard. Any update on review?

Once reviewed we can simply set:
$wgUploadWizardConfig['enableFormData'] = true;

And we need to deploy the mediaWiki trunk side api changes related to adding upload files in chunks:
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93720

mdale wrote:

Resumable upload using database to sync state patch

I think some things can still be cleaned up, but all working, so I wanted to get feedback.

Changes Overview:

  • Subclass out UploadFromChunks having it extend UploadFromFile since it was getting kind of messy having UploadFromFile handling both cases.
  • The main execute function in ApiUpload was getting a little long and hard to follow, re factored at least the result context part into a few private methods.
  • Added sa_chunk_inx filed to uploadstash for keeping track of the chunk inx. Added to tables.sql and mysqlUpdater.php / patch-uploadstash_chunk.sql )
  • Deprecated appendToUploadFile and appendFinish in UploadBase for 1.19 since we won't have append around in the future.
  • removed getFileTempname from UploadFromFile ( not used anywhere )
  • To simplify implementation mFile is left as a reference to the original first stashed chunk, and just put chunks into the stashed folder by number

Attached:

jgerber wrote:

tested with trunk and works fine so far,
one issue i saw is that the chunks are not deleted after concatenation.
passing the DELETE_SOURCE flag fixes that.

+ $status = $this->repo->concatenate( $fileList, $this->mVirtualTempPath, FileRepo::DELETE_SOURCE );

(Patch applied, will be enabled when chunked uploading support is in the API.)

Thehelpfulonewiki wrote:

Reassigning to wikibugs-l per bug 37789

Gilles raised the priority of this task from High to Unbreak Now!.Dec 4 2014, 10:21 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to High.Dec 4 2014, 11:21 AM