Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top