From b0bb9a55d5e4071f45a2d8058f3d433f7598a6eb Mon Sep 17 00:00:00 2001 From: ViralKansodiya <141210323+viralkansodiya@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:13:31 +0530 Subject: [PATCH] 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 --- frappe/utils/response.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/utils/response.py b/frappe/utils/response.py index 1458595148..fa4e615a9f 100644 --- a/frappe/utils/response.py +++ b/frappe/utils/response.py @@ -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