Page MenuHomePhabricator

Chunked uploads: fails immediately when trying to upload large JPEG due to binReader.result being undefined
Closed, DeclinedPublic


I was trying to upload a JPEG file using chunked uploads. It is 270 MB (283,562,965 bytes) and 24576 x 29696 (730 megapixels / 729808896 pixels). The file was created using ImageMagick 6.7.9-8 2012-09-22 Q16 ("convert a.tiff a.jpg"). As soon as I try to upload it fails immediately at:

Error: at line 471: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMFileReader.result]

 if( this.file.type === 'image/jpeg' ) {
     var binReader = new FileReader();
     binReader.onload = function() {
         var binStr;
         if ( typeof binReader.result == 'string' ) {
>            binStr = binReader.result;
         } else {

Debugging in Firebug shows that binReader.result is undefined at the time of failure.

binReader FileReader {readyState=2,onload=[xpconnect wrapped nsIDOMEventListener],EMPTY=0, more...}
   constructor=[object FileReader],
   __proto__=[xpconnect wrapped native prototype] { ... }

I got the same failure in Chrome and Firefox. IE apparently has no chunked uploads support at all, as I'm unable to upload any file in it, it just claims to be uploading but uses no bandwidth.

I have no trouble uploading a smaller 90 MB JPEG file.

Version: unspecified
Severity: major
See Also:



Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 12:47 AM
bzimport added a project: UploadWizard.
bzimport set Reference to bz40586.
bzimport added a subscriber: Unknown Object (MLST).

An update: I re-encoded the same image at 70% quality, bringing it down to 109 MB, and it uploaded with no problem. At 80% quality (144 MB) it failed. This suggests the image size/format/generation process are not at issue, but rather the file size in combination with the file type. Also, the maximum appears to be somewhere between 109 and 144 MB (perhaps 128MB? might be a browser limitation?)

Another update: the file size trials in the previous comment were done on Chrome on Windows 7 x64 with 8 GB RAM. When moving to Firefox on Ubuntu Linux 64-bit with 2 GB of RAM, the same issue occurred but the maximum size was considerably higher: somewhere between 175 MB and 277 MB, about twice as much.

Gilles moved this task from Untriaged to Prototyping on the Multimedia board.Nov 24 2014, 4:07 PM
Gilles moved this task from Prototyping to Untriaged on the Multimedia board.Apr 6 2015, 9:23 AM
Jdforrester-WMF moved this task from Untriaged to Backlog on the Multimedia board.Sep 4 2015, 6:24 PM
Restricted Application added subscribers: Steinsplitter, Matanya, Aklapper. · View Herald TranscriptSep 4 2015, 6:24 PM
matmarex updated the task description. (Show Details)Sep 9 2015, 10:53 PM
matmarex set Security to None.
matmarex removed a subscriber: wikibugs-l-list.

@Dcoetzee sorry to come back to this after all this time, but could you provide us with the image so we can determine if this is still an issue? Thanks.

MarkTraceur closed this task as Declined.Dec 7 2015, 5:08 PM
MarkTraceur claimed this task.

I think this is impossible, so until someone else reports it, closing

Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptDec 7 2015, 5:08 PM