Fix form data files being replaced by the last decrypted file

This commit is contained in:
Omar Ahmed Hassan 2024-12-17 01:01:15 +02:00
parent 64ee26facf
commit 4998ad064a
No known key found for this signature in database
GPG Key ID: ABE806D1E7CA21AE

View File

@ -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);
});
}