From e1576aba18c2970930c1658d1a04ce1f8193b3e9 Mon Sep 17 00:00:00 2001 From: Marc Durepos Date: Thu, 21 Sep 2023 20:00:42 -0400 Subject: [PATCH] Download working well with content-dispoition and filename. --- bemade_documents_portal/controllers/portal.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bemade_documents_portal/controllers/portal.py b/bemade_documents_portal/controllers/portal.py index 0e0c917..b33fe63 100644 --- a/bemade_documents_portal/controllers/portal.py +++ b/bemade_documents_portal/controllers/portal.py @@ -60,5 +60,6 @@ class DocumentCustomerPortal(CustomerPortal): headers = [ ('content-type', attachment.mimetype), ('content-length', attachment.file_size), + ('content-disposition', f'attachment; filename="{document.name}"') ] return request.make_response(attachment.raw, headers)