【发布时间】:2013-12-23 15:51:30
【问题描述】:
我已阅读 Open a file from urlfetch in GAE 和 Google App Engine, How to make native file object?,但仍不知道如何将 .pdf 文件从 URL 保存到 Google 数据存储或 Blob 存储。 任何提示或指向工作示例的指针?
我正在使用 Python,我的代码本质上是来自 https://developers.google.com/appengine/docs/python/urlfetch/?hl=it-IT&csw=1 的代码
from google.appengine.api import urlfetch
url = "http://www.gutenberg.org/files/1342/1342-pdf.pdf"
result = urlfetch.fetch(url)
if result.status_code == 200:
doSomethingWithResult(result.content)
【问题讨论】:
标签: google-app-engine python-2.7 google-cloud-datastore blobstore urlfetch