Firefox不保存带有扩展名的文件

时间:2018-07-10 06:37:23

标签: python django

我在Django应用程序中有一个视图,该视图创建XLSX文件并将其返回给用户下载:

# Creates the response
response = HttpResponse(output.read(),
                            content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
response['Content-Disposition'] = 'attachment; filename="{}".xlsx'.format(tournament.name)

当我尝试在Chrome浏览器中下载文件时,它可以正常运行:文件名为“ blabla.xlsx”下载。

但是,使用Firefox时,下载文件名为“ blabla”(无扩展名)。

您遇到过这个问题吗?

0 个答案:

没有答案
相关问题