GWT GAE 通过 Blob 上传
如果我使用 GWT 文件小部件和表单面板,有人可以解释如何在 google 应用程序引擎上处理 blobstore 上的上传吗?
If I'm using GWT File widget and form panel, can someone explain how to handle upload on blobstore on google application engine??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请查看 gwtupload。有 有关如何将其与 GAE Blobstore 一起使用的示例。
Take a look at gwtupload. There are examples on how to use it with GAE Blobstore.
Google blobstore 专门设计用于通过 http 上传和提供 blob。 Blobstore 服务(使用
BlobstoreServiceFactory.getBlobstoreService()
获得)生成 http post 操作供您在 html 表单中使用。通过向其中发布文件,您可以将 blob 上传到 blobstore。当您生成此操作时,您将提供一个处理程序 (servlet) 的路径,您可以在其中访问上传的 blob 密钥:请注意,“数据”是表单中的文件字段。您所拥有的只是 blob(您的文件)的密钥。从这里您可以控制 - 您可以保存此密钥以供以后使用和/或立即在页面上提供 blob(使用密钥):
当然,有关详细信息,请参阅 Google 文档。
Blobstore 的一个很好的功能是它与 Google Mapper(基本的 Map-Reduce)服务(正在进行中)集成,可以让您逐行处理作为 Blob 上传的文件: http://ikaisays.com/2010/08/
Google blobstore is specifically designed to upload and serve blobs via http. Blobstore service (obtained using
BlobstoreServiceFactory.getBlobstoreService()
) generates http post action for you to use in the html form. By posting file to it you upload your blob to the blobstore. When you generate this action you provide a path to the handler (servlet) where you have access to uploaded blob key:Note, that "data" is the file field in your form. All you have is a key to the blob (your file). From here you take control - you can save this key for later and/or immediately serve the blob on a page (using key):
Of course, for details see Google documentation.
One nice feature of the blobstore that it's integrated with Google Mapper (rudimentary map-reduce) service (work in progress) which lets you process files uploaded as blobs line by line: http://ikaisays.com/2010/08/