您的位置:首页 > 其它

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

2013-08-09 06:10 253 查看
http://www.reigndesign.com/blog/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

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐