503和400在Google App Engine中上传图片 [英] 503 and 400 on uploading images in Google App Engine

查看:98
本文介绍了503和400在Google App Engine中上传图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我在将文件上传到我的Java gae应用程序时遇到了两个问题。
我正在使用 blobstore文档中介绍的技巧 。


  1. 对于普通文件,偶尔会有客户收到503服务不可用(比如15%的次数)。

  2. 高分辨率图片(例如7000x10000)客户端总是收到400错误请求。

在服务器上的两种情况下,都没有记录错误消息,blob写入正确,但successPath url( createUploadUrl )永远不会被调用。看起来处理上传的GAE端点出于某些原因崩溃。



我的客户端是一个js XMLHttpRequest,包装在GWT中:

  public native void uploadWithXMLHttpRequest(UploadForm uploadForm)/ *  -  {
var fd = new FormData();
var files = uploadForm。@ mypackage.UploadForm :: getFiles()();
for(var i = 0; i< files.length; i ++){
fd.append(uploadFile+ i,files [i]);
}
var xhr = new XMLHttpRequest();
//xhr.upload.addEventListeners ...省略
xhr.open(POST,uploadForm。@ mypackage.UploadForm :: getUploadUrl()());
xhr.send(fd);
}

可能的原因和解决方案/解决方法的任何想法?
Thx。

解决方案

这个问题正在由具有相同问题的其他用户打开的GAE票证中讨论:< href =https://code.google.com/p/googleappengine/issues/detail?id=7619 =nofollow> https://code.google.com/p/googleappengine/issues/detail? id = 7619 (顺便说一句,错误跟踪系统有一个开始功能,它允许您投票支持票和接收通知)

Recently I experienced two problems in uploading files to my Java gae app. I'm using the tecnique described in the blobstore doc.

  1. With regular files, occasionally (let's say 15% of times) the client receives a "503 Service Unavailable".
  2. With high resolution images (example 7000x10000) the client always receives a "400 Bad Request".

On both cases on the server there are no error messages logged, the blobs are written correctly, but the successPath url (the callback of createUploadUrl) is never called. It seems that the GAE endpoint handling the upload crashes for some reasons.

My client is a js XMLHttpRequest, wrapped in GWT:

public native void uploadWithXMLHttpRequest(UploadForm uploadForm) /*-{
    var fd = new FormData();
    var files = uploadForm.@mypackage.UploadForm::getFiles()();  
    for (var i = 0; i < 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);
}

Any ideas for possible causes and solutions/workarounds? Thx.

解决方案

This issue is being discussed in a GAE ticket opened by another user having the same problem: https://code.google.com/p/googleappengine/issues/detail?id=7619 (btw, the bug tracker system has a "start" feature, which allows you to vote for the ticket and receive notifications)

这篇关于503和400在Google App Engine中上传图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆