def upload_image(): # put application's code here if request.method == "POST": image = request.files.get('file', '') print(image)
我想在变量中获取名称“new.jpg”,但却得到了〈文件存储:'新. jpg'('图像/jpeg')〉作为输出
nzk0hqpo1#
您可以使用filename属性:
filename
def upload_image(): if request.method == "POST": image = request.files.get('file', '') image_name = image.filename print(image_name)
1条答案
按热度按时间nzk0hqpo1#
您可以使用
filename
属性: