def get_file(file_url): download_file(file_url) file_content = frappe.response.file_content del frappe.local.response.file_content del frappe.local.response.file_name del frappe.local.response.type return [file_url, file_content]
def download_attachment(dn): attachment = get_attachments("Prepared Report", dn)[0] download_file(attachment.file_url)