flask.send_from_directory 文件名包括中文报错

解决方法:

response = make_response(send_from_directory(directory, filename, as_attachment=True))

response.headers["Content-Disposition"] = "attachment; filename{}".format(filename.encode().decode('latin-1'))

return response

参考:https://blog.csdn.net/kalulioo/article/details/83182041

你可能感兴趣的:(flask.send_from_directory 文件名包括中文报错)