From 4998ad064a115835fbbf7cb745b81017eb33559e Mon Sep 17 00:00:00 2001 From: Omar Ahmed Hassan Date: Tue, 17 Dec 2024 01:01:15 +0200 Subject: [PATCH] Fix form data files being replaced by the last decrypted file --- src/main/resources/static/js/downloader.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/js/downloader.js b/src/main/resources/static/js/downloader.js index 57ae8c47..752d459b 100644 --- a/src/main/resources/static/js/downloader.js +++ b/src/main/resources/static/js/downloader.js @@ -75,9 +75,10 @@ // Check if any PDF files are encrypted and handle decryption if necessary const decryptedFiles = await checkAndDecryptFiles(url, files); files = decryptedFiles; + formData.delete('fileInput'); // Reset fileInput and Append // Append decrypted files to formData decryptedFiles.forEach((file, index) => { - formData.set(`fileInput`, file); + formData.append(`fileInput`, file); }); }