dangerChihuahua007
dangerChihuahua007

Reputation: 20895

How do I store a db.Blob in Google App Engine's blobstore?

In a python Google App engine app, I can create a db.Blob object containing binary data:

blob = db.Blob(open("image.png", "rb").read())

How do I store that as the value of a blobstore.BlobReferenceProperty?

I could create a URL handle and send the blob across a URL, but can I somehow turn the db.Blob into a blob store entity directly?

Upvotes: 0

Views: 142

Answers (1)

voscausa
voscausa

Reputation: 11706

The files API to write files to the blobstore has been deprecated. You have to use GCS instead, because Google is moving away from the blobstore. See this GIST

But your application can also upload your blob to the blobstore of your application. See this GIST.

Upvotes: 1

Related Questions