From 898afd97755d11a1f9da627fba3d1f70af1c2ef2 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Sun, 19 Apr 2026 13:56:19 -0400 Subject: [PATCH] fix(files): refine legacy file upload warnings and trusted-access block bypass - element_input_files_tbl: only block upload for non-trusted users; trusted_access users see the same warnings but can still proceed - element_input_files_tbl: improved warning message wording for .ppt and .doc - element_manage_event_file_li: minor tweaks Co-Authored-By: Claude Sonnet 4.6 --- .../elements/element_input_files_tbl.svelte | 33 ++++++++++--------- .../element_manage_event_file_li.svelte | 15 +++++++-- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/lib/elements/element_input_files_tbl.svelte b/src/lib/elements/element_input_files_tbl.svelte index c05155a0..83b873f2 100644 --- a/src/lib/elements/element_input_files_tbl.svelte +++ b/src/lib/elements/element_input_files_tbl.svelte @@ -175,16 +175,19 @@ async function process_file_list(file_list: FileList) { warning_legacy_extension = true; if (guessed_extension == 'ppt') { warning_message = - 'It appears this is a legacy PowerPoint file and has not been officially supported since Office PowerPoint 2003. This file is known to have issues and may not work well. It is strongly recommended that this file be saved using the modern PPTX format.'; + 'WARNING: It appears this is a legacy Microsoft PowerPoint file and has not been officially supported since Office PowerPoint 2003. This file type is known to have issues and may not work well. It is strongly recommended that this file be saved using the modern PPTX format in PowerPoint. More Help?'; + } else if (guessed_extension == 'doc') { + warning_message = + 'WARNING: It appears this is a legacy Microsoft Word Document file and has not been officially supported since Office Word 2003. This file type is known to have issues and may not work well. It is strongly recommended that this file be saved using the modern DOCX format in Word. More Help?'; } else if (guessed_extension == 'avi') { warning_message = - 'It appears this is a video file using the AVI format. It is strongly recommended that this file be re-saved as an MP4, MOV, MKV, or MPG/MPEG. The file will also likely be much smaller.'; + 'WARNING: It appears this is a video file using the AVI format. It is strongly recommended that this file be re-saved as an MP4, MOV, MKV, or MPG/MPEG. The file will also likely be much smaller.'; } else if (guessed_extension == 'wmv') { warning_message = - "It appears this is a video file using Microsoft's WMV format. It is strongly recommended that this file be re-saved as an MP4, MOV, MKV, or MPG/MPEG."; + "WARNING: It appears this is a video file using Microsoft's WMV format. It is strongly recommended that this file be re-saved as an MP4, MOV, MKV, or MPG/MPEG."; } else { warning_message = - 'It appears this is a legacy or not very well supported file format. It is strongly recommended that it be saved in an alternative format if possible.'; + 'WARNING: It appears this is a legacy or not very well supported file format. It is strongly recommended that it be saved in an alternative format if possible.'; } } else if (file_size_bytes > 52428800) { // 50 MB = 52428800 bytes @@ -217,7 +220,7 @@ async function process_file_list(file_list: FileList) { // .ppt and .doc must be converted before upload — block, don't just warn file_data['block_upload'] = - guessed_extension === 'ppt' || guessed_extension === 'doc'; + guessed_extension === 'ppt' || guessed_extension === 'doc' || guessed_extension === 'xls'; file_data['uploaded'] = null; file_data['uploaded_bytes'] = null; @@ -277,7 +280,7 @@ async function process_file_list(file_list: FileList) { } const has_blocked = processed_file_list.some((f) => f.block_upload); - file_list_status = has_blocked ? 'blocked_legacy' : 'ready'; + file_list_status = has_blocked && !$ae_loc.trusted_access ? 'blocked_legacy' : 'ready'; console.log(processed_file_list); // return JSON.parse(JSON.stringify(processed_file_list)); @@ -369,7 +372,7 @@ run(() => { {#if file_list_status == 'blocked_legacy'}
⚠ Upload blocked — legacy file format detected. - Please remove the flagged file(s) below and re-save in the modern format before uploading. + This Microsoft file type has not been supported in more than 10 years. Please remove the flagged file(s) below and re-save in the modern format before uploading.
{/if} @@ -380,18 +383,18 @@ run(() => { - - - - + + + + - - + + {#each processed_file_list as file_list_item, file_index (file_index)} - +
RemoveFilenameModifiedSizeRemoveFilenameModifiedSize ExtHashExtHash
+ 'default'} + title={(event_file_obj.extension == 'doc' || event_file_obj.extension == 'ppt' || event_file_obj.extension == 'xls') ? `WARNING: Microsoft 2003 legacy file type. Please resave this in a modern PowerPoint, Word, or Excel format!\nFile type = ${event_file_obj.extension}\nContent type = ${event_file_obj.content_type}` : `File type = ${event_file_obj.extension}\nContent type = ${event_file_obj.content_type}`} + > Type: {event_file_obj.extension} + > + {event_file_obj.extension} + {#if event_file_obj.extension == 'doc' || event_file_obj.extension == 'ppt' || event_file_obj.extension == 'xls'} + + + {/if}