- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
错误
Caused by: java.lang.IllegalStateException: Must be called from a blob upload callback request. at com.google.appengine.api.blobstore.BlobstoreServiceImpl.getUploads(BlobstoreServiceImpl.java:169)
代码
public class UserUploadProfilePictureResource extends ServerResource {
@Post
public void handleBlobstoreUpload(Representation entity) {
Representation rep =null;
if (entity !=null) {
if (MediaType.MULTIPART_FORM_DATA.equals(entity.getMediaType(), true)) {
Request restletRequest = getRequest();
HttpServletRequest servletRequest = ServletUtils.getRequest(restletRequest);
BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
Map<String, List<BlobKey>> blobs = blobstoreService.getUploads(servletRequest);
可能的解决方案(但我不想要的)
首先。我不想调用第二个 HttpServlet。
其次。关于这篇文章,有手动编写文件的解决方案:
Google 表示如下:
Deprecated: The Files API feature used here to write files to Blobstore is going to be removed at some time in the future, in favor of writing files to Google Cloud Storage and using Blobstore to serve them.
可能的解决方案 2(但只是解决方法的概念)
http://www.cloudave.com/1055/the-new-google-app-engine-blobstore-api-first-thoughts/
Bret Slatkin notes that when the API manufactures the POST URL to be used for uploading the files, it creates a unique one-time URL which which mitigates any potential sniffing.
This fits perfectly for the scenario when you’re rendering a web form to be submitted by the user. But, it makes things harder if you’re trying to provide a REST API that allows uploading files (think of something like TwitPic for example). In this case you’ll have to write your own render that simulates what a web form would do (get the files, create random POST URL, call it, …)
问题
在 Google 应用引擎中存储图像的最佳方法是什么?有比 blobstore 更好的方法吗?如何在 blobstore 中存储图像?
最佳答案
我认为您最好的选择是 Google Cloud Storage Client Library,并将得到官方支持,https://developers.google.com/appengine/docs/java/googlecloudstorageclient/看起来他们将不再支持以编程方式写入 blobstore,可能是为了促进云存储在 blobstore 上的使用。图像和 blobstore api 在 GCS 上工作,用于创建和存储 blobstore key 以及生成图像 url/调整大小等。
另一种我没有深入研究的非官方方式是复制 Files Api 源并自己维护它,它可能使用不会消失或始终可用的 rpc 调用,但我不太清楚。
关于java - Google App Engine Blobstore 和 ReSTLet - "Must be called from a blob upload callback request",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18042248/
Google Cloud Compute 中的 Google Compute Engine、App Engine 和 Container Engine 之间的实际区别是什么?什么时候使用什么? 有什么
我有一个在 Google App Engine 中运行的应用程序,它访问在 Google Compute Engine 中的机器上运行的服务。 Google App Engine 应用程序是该服务唯一
我们正在谷歌云中构建一个应用程序。我们使用 App Engine 作为前端,使用 Compute Engine 作为后端。在这些 Compute Engine 实例上,我正在运行一个接受特定“命令”消
我有一个现有的 GAE 应用程序(我们称之为应用程序 A)正在运行的情况,但由于非技术原因无法修改。当用户迁移到新的客户端版本时,我们需要将他们的数据从应用程序 A 迁移到新的 GAE 应用程序(我称
我正在尝试发现 App Engine 上的其他已部署服务。类似于 this文章建议。 我的代码是这样的: import ( "fmt" "net/http" "google.g
我想在我的网站上为“图像处理”事件设置服务器。如果我在 GCE 中使用“n1-standard-1”实例,GAE 中的可比功率是多少?是因为我算错了,还是同一个功率两者价格相差很大? 最佳答案 按小时
我在 Googl Compute Engine 和 Google App Engine 标准环境中的应用程序中创建了一个 VM 实例。我打算在 App Engine 中使用我的应用程序,在 Compu
我像往常一样使用 appcfg.py 更新我的应用程序,但收到一条错误消息。我试过 appcfg.py 回滚,两次尝试之间等了十分钟,但我仍然收到相同的错误消息。我该怎么办? 无法对 apps/dev
我想在 Google Compute Engine 上放置一个 Redis 服务器,并通过 AppEngine 的套接字支持与其对话。唯一的问题是似乎没有特定的防火墙规则说“此 AppEngine 应
我想知道 App Engine 和 Compute Engine 之间有什么区别。任何人都可以向我解释其中的区别吗? 最佳答案 App Engine 是一种平台即服务。这意味着您只需部署代码,平台会为
我正在编写一个在 App Engine 的 Go 运行时上运行的 Go 应用程序。 我注意到几乎所有使用 App Engine 服务(例如 Datastore、Mail 甚至 Capabilities
是否有人有在 Grid Engine/Sun Grid Engine/Son of Grid Engine 上运行 Docker 的经验,并且能够 monitor the resource used
我读了很多论坛,因为 grails app-engine 插件多年来没有更新,所以不可能将 grails 应用程序部署到谷歌应用程序引擎。当我准备放弃时,我发现使用 intellij 部署项目是可能的
当前设置, 运行 Windows Server 2012 (GCE Server 2012) 的谷歌计算引擎 运行 Debian Wheezy(GCE 服务器 Wheezy)的 Google 计算引擎
特定于基于 Docker 的部署,这两者之间有什么区别?由于 Google App Engine Flexible 现在也支持基于 Dockerfile 的部署,并且它也是完全托管的服务,因此它似乎比
我相信 Google Kubernetes Engine (GKE) 在 Google Compute Engine (GCE) 上运行。那么,在服务器管理方面使用 Google Kubernetes
TLDR;关于这个问题有任何更新吗? Google App Engine communicate with Compute Engine over internal network -- 是否可以在同
我正在尝试使用 Go SDK 为 App Engine 编写应用程序,但它似乎与单元测试有一种有趣的关系。人有written libraries左右this original, outdated一组工
在 App Engine 中,我想对在同一个 Google 云项目中创建的 Compute Engine 实例上运行的网络服务器进行 http fetch 调用,我想知道是否可以在不启用的情况下对实例
在编写 Go App Engine 标准应用程序时,过去的情况是您必须使用 App Engine SDK访问数据存储。然而,最近(从 Go 1.11 开始?),如果你只使用 Cloud Datasto
我是一名优秀的程序员,十分优秀!