简体   繁体   English

如何使用GAE获取上传文件的文件名?

[英]How can I get the filename of an uploaded file with GAE?

I just upload it to the db (coming from a user request) like this: 我只是将它上传到db(来自用户请求),如下所示:

 x.file = db.Blob(self.request.get("img"))

How do I get the filename, I have both the request and the blob, any solution that could be applied for any of them is ok for me 我如何获取文件名,我有请求和blob,任何可以应用于任何一个的解决方案对我来说都没问题

The object that is returned by self.request.get("img") will have a property called filename . self.request.get("img")返回的对象将具有名为filename的属性。 Assuming that "img" is a file upload, of course. 当然,假设“img”是文件上传。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM