Merge branch 'main' into bug/2490/2488/image-to-pdf

This commit is contained in:
reecebrowne
2024-12-18 10:40:54 +00:00
committed by GitHub
105 changed files with 535 additions and 547 deletions

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);
});
}
@@ -86,7 +87,7 @@
if (remoteCall === true) {
if (override === 'multi' || (!multipleInputsForSingleRequest && files.length > 1 && override !== 'single')) {
await submitMultiPdfForm(url, files);
await submitMultiPdfForm(url, files, this);
} else {
await handleSingleDownload(url, formData);
}
@@ -366,7 +367,7 @@
return {filename, blob};
}
async function submitMultiPdfForm(url, files) {
async function submitMultiPdfForm(url, files, form) {
const zipThreshold = parseInt(localStorage.getItem('zipThreshold'), 10) || 4;
const zipFiles = files.length > zipThreshold;
let jszip = null;
@@ -389,7 +390,9 @@
// Get existing form data
let formData;
if (postForm) {
if (form) {
formData = new FormData(form);
} else if (postForm) {
formData = new FormData($(postForm)[0]); // Convert the form to a jQuery object and get the raw DOM element
} else {
console.log('No form with POST method found.');