mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2024-12-21 19:08:24 +01:00
Merge pull request #2492 from omar-ahmed42/fix-no-formdata-sent-in-multi
Fix: form data not being sent in multi
This commit is contained in:
commit
b0daac2566
@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
if (remoteCall === true) {
|
if (remoteCall === true) {
|
||||||
if (override === 'multi' || (!multipleInputsForSingleRequest && files.length > 1 && override !== 'single')) {
|
if (override === 'multi' || (!multipleInputsForSingleRequest && files.length > 1 && override !== 'single')) {
|
||||||
await submitMultiPdfForm(url, files);
|
await submitMultiPdfForm(url, files, this);
|
||||||
} else {
|
} else {
|
||||||
await handleSingleDownload(url, formData);
|
await handleSingleDownload(url, formData);
|
||||||
}
|
}
|
||||||
@ -367,7 +367,7 @@
|
|||||||
return {filename, blob};
|
return {filename, blob};
|
||||||
}
|
}
|
||||||
|
|
||||||
async function submitMultiPdfForm(url, files) {
|
async function submitMultiPdfForm(url, files, form) {
|
||||||
const zipThreshold = parseInt(localStorage.getItem('zipThreshold'), 10) || 4;
|
const zipThreshold = parseInt(localStorage.getItem('zipThreshold'), 10) || 4;
|
||||||
const zipFiles = files.length > zipThreshold;
|
const zipFiles = files.length > zipThreshold;
|
||||||
let jszip = null;
|
let jszip = null;
|
||||||
@ -390,7 +390,9 @@
|
|||||||
|
|
||||||
// Get existing form data
|
// Get existing form data
|
||||||
let formData;
|
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
|
formData = new FormData($(postForm)[0]); // Convert the form to a jQuery object and get the raw DOM element
|
||||||
} else {
|
} else {
|
||||||
console.log('No form with POST method found.');
|
console.log('No form with POST method found.');
|
||||||
|
Loading…
Reference in New Issue
Block a user