Aditya Hase 2019-11-15 15:44:39 +05:30 committed by Suraj Shetty
parent 58867eb671
commit 175b974910

View file

@ -90,7 +90,7 @@ def as_json():
def as_pdf():
response = Response()
response.mimetype = "application/pdf"
encoded_filename = quote(frappe.response['filename'].replace(' ', '_'), encoding='utf-8')
encoded_filename = quote(frappe.response['filename'].replace(' ', '_'))
response.headers["Content-Disposition"] = ("filename=\"%s\"" % frappe.response['filename'].replace(' ', '_') + ";filename*=utf-8''%s" % encoded_filename).encode("utf-8")
response.data = frappe.response['filecontent']
return response