Get original filename google app engine

后端 未结 2 1985
旧巷少年郎
旧巷少年郎 2021-01-19 17:16

When receiving a file upload on google app engine, the example assumes you\'re receiving a .png. However you only konw what the type of the image is by the extension on the

2条回答
  •  萌比男神i
    2021-01-19 17:46

    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:

    
    

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

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

提交回复
热议问题