Fixing “Upload Aborted or Timed Out” errors in iTunes Connect

When you're uploading screenshots to iTunes Connect, you may run into the error "Upload Aborted or Timed Out". This can be very frustrating if you're on a slow connection. Sometimes, retrying the upload may succeed, or converting the files to JPGs.

This is not ideal: we'd like to be able to upload nice hi-res iPad screenshots, even on a slow connection. I did some digging in iTunes Connect's Javascript. It turns out it uses a component called LCUploader to handle the uploading. Deep in the bowels of a file called lc_ajaxcomponents.js, we find this code:

self.timerId = setInterval(function() { self.checkUploadHeartbeat(); }, 10000);
...
this.checkUploadHeartbeat = function() {
        if (this.lastProgressDate == 0) { return; }
        
        var now = new Date().getTime();
        var diff = now - this.lastProgressDate;
        if (diff > 10000) {
            
            // We have waited more than 10 seconds without any bytes being pushed
            clearInterval(this.timerId);
            // Mark the request as being aborted
            this.aborted = true;
            // And finally abort the XHR
            this.xhrRequest.abort();
            this.displayErrorMessage("Upload Aborted or Timed Out.");
            this.reset();
            this.stopSpinner();

Aha! It appears that this check is incorrectly causing the upload to time out after 10 seconds. We can override this function at runtime. Paste the following code into your browser's address bar:

javascript:LCUploader.prototype.checkUploadHeartbeat = function() {};void(0);

This overrides the function with an empty one. Now we're able to upload larger files with no issues, even on a bad wifi connection in Tonga 😉

Matt Mayer

Matt Mayer is a founder at ReignDesign. Matt is from the UK and was based in Shanghai for ten years. He is now living in Bangkok, Thailand.

7 comments

  1. You just totally saved my day too! I’m trying to submit from a public wi-fi on a beach, at the end of the world, and the connection leaves a little to be desired!! Thank you!!!

  2. This was simply awesome… on reading this, I didn’t believe it would work… but I applied this and bingo…. hats off… great piece of workaround…

Leave a Reply

Your email address will not be published. Required fields are marked *