From 39b881dbe6c7a0fd5904c99677b2ebe9216136b6 Mon Sep 17 00:00:00 2001 From: ThomasWhittington <46750921+ThomasWhittington@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:02:00 +0100 Subject: [PATCH] feat: added support for excel sheets (#119) Co-authored-by: Tom Whittington --- .../Views/Shared/RichText/Custom/_Attachment.cshtml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml index 6b74d22..677a5ad 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/Custom/_Attachment.cshtml @@ -1,10 +1,17 @@ @model CustomAttachment
+ @{ + var fileExtension = Model.ContentType.Split('/').Last().ToLower(); + if (fileExtension == "vnd.openxmlformats-officedocument.spreadsheetml.sheet") + { + fileExtension = "xlsx"; + } + } +