如何使用Google App Engine的Blobstore保存网络图像 [英] How to use Google App Engine's Blobstore to save web images
问题描述
UPDATE
这个问题最初是在没有支持编程文件创建的时候提出的(通过url例)。这已经改变,请参阅: http://code.google.com /appengine/docs/java/blobstore/overview.html#Writing_Files_to_the_Blobstore
我正在访问几个不同的API来提取图片。我的应用程序是GAE + Python,我想使用Blobstore来保存这些图像。 GAE Blobstore文档提供了有关如何通过表单将图像保存到Blobstore的清晰示例,但不是直接从url中获取。
我想知道如何保存 http://api.website.com/images/foo.jpg 至Blobstore。
使用新的File API与urlfetch API结合使用,您应该可以通过表单传递图像url,将其提取到服务器端并将其写入blobstore:
UPDATE
This question was originally asked at a time when there was no support for programmatic file creation (via url for example). That has changed, see: http://code.google.com/appengine/docs/java/blobstore/overview.html#Writing_Files_to_the_Blobstore
I'm accessing a couple different APIs to fetch images. My application is GAE + Python and I want to use the Blobstore to save these images. The GAE Blobstore documentation provides clear examples of how to save images to Blobstore via a form, but not directly from an url.
I want to know how to save http://api.website.com/images/foo.jpg to the Blobstore.
Using the new File API in combination with urlfetch API you should be able to pass the image url through the form, fetch it server-side and write it to the blobstore:
这篇关于如何使用Google App Engine的Blobstore保存网络图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!