Michael
Michael

Reputation: 33

AppEngine: Out of Blobstore and into S3?

I'm uploading data to the blobstore. There should it stay only temporary and be uploaded from within my AppEngine app to Amazon S3.

As it seems I can only get the data through a BlobDonwloadHandler as described at the Blobstore API: http://code.google.com/intl/de-DE/appengine/docs/python/blobstore/overview.html#Serving_a_Blob

So I tried to fetch that blob specific download URL from within my application (remember my question yesterday). Fetching internal URLs from within the AppEngine (not the development server) is working, even it´s bad style - I know.

But getting the blob is not working. My code looks like:

result = urllib2.urlopen('http://my-app-url.appspot.com/get_blob/'+str(qr.blob_key))

And I'm getting

DownloadError: ApplicationError: 2

Raised by:

File "/base/python_runtime/python_lib/versions/1/google/appengine/api/urlfetch.py", line 332, in _get_fetch_result raise DownloadError(str(err))

Even after searching I really don't know what to do.

All tutorials I've seen are focusing only on serving through a URL back to the user. But I want to retrieve the blob from the Blobstore and send it to a S3 bucket. Anyone any idea how I could realize that or is that even not possible?

Thanks in advance.

Upvotes: 1

Views: 651

Answers (1)

Calvin
Calvin

Reputation: 4195

You can use a BlobReader to access that Blob and send that to S3.

http://code.google.com/intl/de-DE/appengine/docs/python/blobstore/blobreaderclass.html

Upvotes: 2

Related Questions