【问题标题】:java + google web toolkit (google apps engine)java + google web toolkit(谷歌应用引擎)
【发布时间】:2012-02-12 12:23:55
【问题描述】:

我需要将图像上传到运行 SmartGWT Web 应用程序的服务器......在尝试了这个解决方案(Basic File upload in GWT - 第一个答案)之后,当我在 web.xml 中创建了带有映射的独立 http servlet 时,我能够在服务器端接收上传的文件(在链接的解决方案中 - “out”是 ByteArrayOutoutStream),所以它在服务器 RAM...问题是,如何将文件保存到服务器文件系统存储。

当我尝试创建 FileOutputStream 而不是 ByteArrayOutoutStream 时,抛出了一个异常,即它是 Google Apps Engine 中的受限类。

任何想法,如何将文件存储到服务器,当它在 GAE 中受到限制时?或者我怎么知道我不希望 FileUploading servlet 在 GAE 下运行?感谢您的任何想法...

【问题讨论】:

    标签: java google-app-engine gwt image-uploading


    【解决方案1】:

    You have no write permissions。但是,您可以使用store the image as a blob 或使用distributed datastore

    来自 TFA:

    App Engine 不支持写入本地文件,因为 应用程序的分布式特性。相反,必须是 持久化应该存储在distributed datastore。更多 信息请参阅runtime sandbox 上的文档。

    【讨论】:

      猜你喜欢
      • 2012-04-11
      • 1970-01-01
      • 1970-01-01
      • 2011-05-06
      • 1970-01-01
      • 2011-11-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多