python后端向前端返回下载文件的文件名中文的问题
作者:互联网
Python3
from urllib.parse import quote
...
response['Content-Disposition'] = 'attachment; filename={0}.xlsx'.format(quote(filename))
Python2
from urllib import quote
...
# 向下兼容 Python2.6 以前的格式化字符串
response['Content-Disposition'] = 'attachment; filename=%s.xlsx' % quote(filename)
标签:xlsx,后端,python,quote,文件名,urllib,filename,attachment,Disposition 来源: https://blog.csdn.net/s_daqing/article/details/113786805