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