title: 503 and 400 on uploading images in Google App Engine
body: <p>Recently I experienced two problems in uploading files to my Java gae app.
  I'm using the tecnique described in the <a href="https://developers.google.com/appengine/docs/java/blobstore/overview" rel="nofollow">blobstore doc</a>.</p>
  
  <ol>
  <li>With regular files, occasionally (let's say 15% of times) the client receives a "503 Service Unavailable". </li>
  <li>With high resolution images (example 7000x10000) the client always receives a "400 Bad Request".</li>
  </ol>
  
  <p>On both cases on the server there are no error messages logged, the blobs are written correctly, but the successPath url (the callback of <a href="https://developers.google.com/appengine/docs/java/javadoc/com/google/appengine/api/blobstore/BlobstoreService.html#createUploadUrl%28java.lang.String%29" rel="nofollow">createUploadUrl</a>) is never called. It seems that the GAE endpoint handling the upload crashes for some reasons.</p>
  
  <p>My client is a js XMLHttpRequest, wrapped in GWT:</p>
  
  <pre><code>public native void uploadWithXMLHttpRequest(UploadForm uploadForm) /*-{
      var fd = new FormData();
      var files = uploadForm.@mypackage.UploadForm::getFiles()();  
      for (var i = 0; i &lt; files.length; i++) {
          fd.append("uploadFile"+i, files[i]);
      }
      var xhr = new XMLHttpRequest();
      //xhr.upload.addEventListeners... omitted
      xhr.open("POST", uploadForm.@mypackage.UploadForm::getUploadUrl()());
      xhr.send(fd);
  }
  </code></pre>
  
  <p>Any ideas for possible causes and solutions/workarounds?
  Thx.</p>