google app engine - Python 2.7 and blobkeys: how to return the filename instead of the url? -
very new python/google app engine , trying work way around pretty massive application. have:
file_keys = self.request.get_all('blobkey').filename file_links = [] key in file_keys: file_links.append('https://www.mysite.com/admin/downloads/%s' % key)
this return similar this:
how go returning file name? (it's form enter information , provide file, , return specific file's filename in email sent out instead of generated url).
i think filename
work shown here: https://developers.google.com/appengine/docs/python/blobstore/blobinfoclass
but have not had luck that.
any input appreciated.
this solution came with:
file_keys = self.request.get_all('blobkey') blob_info_list = blobstore.blobinfo.get(file_keys) file_info_list = [] blob in blob_info_list: info = {"file_name":blob.filename, "key":blob.key()} file_info_list.append(info) template_dict = { 'file_info_list':file_info_list}
Comments
Post a Comment