From 7675ed0145882282ca70ac604e128a92ec8b1172 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 5 Jan 2026 12:14:01 +0100 Subject: [PATCH] add (not exactly correct -> see fixme) mime types for docx and xlsx --- include/attach.php | 6 ++++++ include/text.php | 2 ++ view/js/mod_cloud.js | 4 +++- view/js/mod_photos.js | 4 +++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/attach.php b/include/attach.php index 9772d7d2a..e9238cbad 100644 --- a/include/attach.php +++ b/include/attach.php @@ -101,8 +101,14 @@ function z_mime_content_type($filename) { // ms office 'doc' => 'application/msword', + // FIXME: this is the correct mime type for docx but it is too long to store in DB (postrges) as of 2026-01-05 + // 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'docx' => 'application/vnd.ms-word', 'rtf' => 'application/rtf', 'xls' => 'application/vnd.ms-excel', + // FIXME: this is the correct mime type for xlsx but it is too long to store in DB (postrges) as of 2026-01-05 + //'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xlsx' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', // open office diff --git a/include/text.php b/include/text.php index cfdd5a6b3..7782752cc 100644 --- a/include/text.php +++ b/include/text.php @@ -3210,10 +3210,12 @@ function getIconFromType($type) { 'application/msword' => 'bi-file-earmark-word', 'application/pdf' => 'bi-file-earmark-pdf', 'application/vnd.oasis.opendocument.text' => 'bi-file-earmark-text', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'bi-file-earmark-text', 'application/epub+zip' => 'bi-file-earmark-text', //Spreadsheet 'application/vnd.oasis.opendocument.spreadsheet' => 'bi-file-earmark-spreadsheet', 'application/vnd.ms-excel' => 'bi-file-earmark-spreadsheet', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'bi-file-earmark-spreadsheet', //Image 'image/jpeg' => 'bi-file-earmark-image', 'image/png' => 'bi-file-earmark-image', diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js index 9669d86f5..7d9692f9e 100644 --- a/view/js/mod_cloud.js +++ b/view/js/mod_cloud.js @@ -529,11 +529,13 @@ function getIconFromType(type) { 'text/html': 'bi-filetype-html', 'application/msword': 'bi-file-earmark-word', 'application/pdf': 'bi-file-earmark-pdf', - 'application/vnd.oasis.opendocument.text': 'bifile--earmark-text', + 'application/vnd.oasis.opendocument.text': 'bi-file-earmark-text', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'bi-file-earmark-text', 'application/epub+zip': 'bi-file-earmark-text', //Spreadsheet 'application/vnd.oasis.opendocument.spreadsheet': 'bi-file-earmark-spreadsheet', 'application/vnd.ms-excel': 'bi-file-earmark-spreadsheet', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'bi-file-earmark-spreadsheet', //Image 'image/jpeg': 'bi-file-earmark-image', 'image/png': 'bi-file-earmark-image', diff --git a/view/js/mod_photos.js b/view/js/mod_photos.js index ca1d85f0c..7582da333 100644 --- a/view/js/mod_photos.js +++ b/view/js/mod_photos.js @@ -141,11 +141,13 @@ function getIconFromType(type) { 'text/html': 'bi-filetype-html', 'application/msword': 'bi-file-earmark-word', 'application/pdf': 'bi-file-earmark-pdf', - 'application/vnd.oasis.opendocument.text': 'bifile--earmark-text', + 'application/vnd.oasis.opendocument.text': 'bi-file-earmark-text', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'bi-file-earmark-text', 'application/epub+zip': 'bi-file-earmark-text', //Spreadsheet 'application/vnd.oasis.opendocument.spreadsheet': 'bi-file-earmark-spreadsheet', 'application/vnd.ms-excel': 'bi-file-earmark-spreadsheet', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'bi-file-earmark-spreadsheet', //Image 'image/jpeg': 'bi-file-earmark-image', 'image/png': 'bi-file-earmark-image',