fix: error while export a doctype report in excel (#22376)

* fix: error while export a doctype report in excel

* Update frappe/utils/response.py

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
This commit is contained in:
ViralKansodiya 2023-09-13 12:13:31 +05:30 committed by GitHub
parent 4b336b47a1
commit b0bb9a55d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,8 +124,9 @@ def as_pdf():
def as_binary():
response = Response()
response.mimetype = "application/octet-stream"
filename = "_".join(frappe.response["filename"].split())
response.headers["Content-Disposition"] = (
'filename="%s"' % frappe.response["filename"].replace(" ", "_")
'filename="%s"' % filename
).encode("utf-8")
response.data = frappe.response["filecontent"]
return response