Google AppEngine BlobInfo() features

1.2k views Asked by At

Hi!

The official GAE documentation instists on existing such heplful BlobInfo instance properties as:

  • content_type;
  • creation;
  • filename;
  • size

I have try to using them in my app, but I'm can't imagine how to do it correctly and I'm can't find a some practical examples how to utilize this GAE features nowhere. Can you help me by demonstation a scratches of verified python code?

Real thanks!

1

There are 1 answers

0
Yasser On

Assuming that you have the key to your blob in a variable named blob_key. You could write code like this:

blob_info = blobstore.BlobInfo.get(blob_key)
print('filename: %s' % blob_info.filename)

blob key is usually returned by the BlobstoreUploadHandler that you use to upload your file.