Get original filename google app engine

天大地大妈咪最大 提交于 2019-12-01 18:40:21

The filename of the file that is being uploaded can be determined by looking at the filename property of the variable that holds the file. For example, let's say that your form has a field named content:

<input type="file" name="content" />

Inside your Handler, you could find the name of the file with:

filename = self.request.POST["content"].filename

It seems that the newly introduced BlobStore has direct support for original filename in the blob's properties. http://code.google.com/appengine/docs/python/blobstore/blobinfoclass.html#BlobInfo_filename

You will need to register a credit card with App Engine to be able to use the BlobStore in production though, even if you don't plan on exceeding the free quotas.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!