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:
parent
4b336b47a1
commit
b0bb9a55d5
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue