From 3206bc14c1b734b43bedcbb50053e74778cfa780 Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Fri, 10 May 2024 15:38:36 -0600 Subject: [PATCH] Fixes JS logic to check max attachment size per post Fixes #7488 Signed-off-by: Jon Stovell --- Themes/default/scripts/smf_fileUpload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Themes/default/scripts/smf_fileUpload.js b/Themes/default/scripts/smf_fileUpload.js index 0a2540c7ad..c0acae4a7b 100644 --- a/Themes/default/scripts/smf_fileUpload.js +++ b/Themes/default/scripts/smf_fileUpload.js @@ -92,7 +92,7 @@ function smf_fileUpload(oOptions) { myDropzone.options.currentUsedSize = myDropzone.options.currentUsedSize + file.size; // This file has reached the max total size per post. - if (totalKB > 0 && currentlyUsedKB > totalKB) { + if (totalKB > 0 && (currentlyUsedKB + uploadedFileKB) > totalKB) { done(myDropzone.options.text_totalMaxSize.replace('{currentTotal}', totalKB).replace('{currentRemain}', currentlyUsedKB)); // Remove the file size from the total