Update 45.制作报表.md

应将{filename}前的 '' 转义为\'\'
pull/725/head
Martin Hunter 2020-12-28 14:31:42 +08:00 committed by GitHub
parent 0d01379603
commit 9a56f40ec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ def export_teachers_excel(request):
# 中文文件名需要处理成百分号编码
filename = quote('老师.xls')
# 通过响应头告知浏览器下载该文件以及对应的文件名
resp['content-disposition'] = f'attachment; filename*=utf-8''{filename}'
resp['content-disposition'] = f'attachment; filename*=utf-8\'\'{filename}'
return resp
```