Reputation: 20409
I save the file to blobstore with
af_file = files.blobstore.create(mime_type=ctype, _blobinfo_uploaded_filename=my_file.filename)
(yes, I know that this is depreciated, but have no other choice since Google Cloud is not available for free)
So, I have the key in result. How could I extract _blobinfo_uploaded_filename
value?
Upvotes: 1
Views: 446
Reputation: 11706
You can get the filename and other properties from Blobinfo. Docs: https://developers.google.com/appengine/docs/python/blobstore/blobinfoclass?hl=nl#BlobInfo_properties
Example:
blob_info= blobstore.BlobInfo.get(blob_key)
file_name = blob_info.filename
You can use a blob upload as an alternative for create.
Upvotes: 2