如何使用Google App Engine的Blobstore保存网络图像 [英] How to use Google App Engine's Blobstore to save web images

查看:113
本文介绍了如何使用Google App Engine的Blobstore保存网络图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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://code.google.com/intl/iw/appengine/docs/python/blobstore /overview.html#Writing_Files_to_the_Blobstore



我想知道如何保存 http://api.website.com/images/foo.jpg 至Blobstore。 解决方案

使用新的File API与urlfetch API结合使用,您应该可以通过表单传递图像url,将其提取到服务器端并将其写入blobstore:



HTTP:// code.google.com/intl/iw/appengine/docs/python/blobstore/ove rview.html#Writing_Files_to_the_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.

http://code.google.com/intl/iw/appengine/docs/python/blobstore/overview.html#Writing_Files_to_the_Blobstore

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:

http://code.google.com/intl/iw/appengine/docs/python/blobstore/overview.html#Writing_Files_to_the_Blobstore

这篇关于如何使用Google App Engine的Blobstore保存网络图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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