From e9f80d03ea38eebb3c3a3a2f5cafbd12f05df137 Mon Sep 17 00:00:00 2001 From: Reece Browne Date: Wed, 18 Dec 2024 00:16:01 +0000 Subject: [PATCH] Fix missing info in form data --- src/main/resources/static/js/downloader.js | 5 ++- .../static/js/pages/adjust-contrast.js | 2 +- .../templates/convert/img-to-pdf.html | 45 ++++++++++++++++--- 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/main/resources/static/js/downloader.js b/src/main/resources/static/js/downloader.js index 57ae8c47b..e2a0364b7 100644 --- a/src/main/resources/static/js/downloader.js +++ b/src/main/resources/static/js/downloader.js @@ -412,8 +412,9 @@ const promises = chunk.map(async (file) => { let fileFormData = new FormData(); fileFormData.append('fileInput', file); - console.log(fileFormData); - // Add other form data + for (let [key, value] of fileFormData.entries()) { + console.log(key, value); + } // Add other form data for (let pair of formData.entries()) { fileFormData.append(pair[0], pair[1]); console.log(pair[0] + ', ' + pair[1]); diff --git a/src/main/resources/static/js/pages/adjust-contrast.js b/src/main/resources/static/js/pages/adjust-contrast.js index 792c06669..a9692d2bc 100644 --- a/src/main/resources/static/js/pages/adjust-contrast.js +++ b/src/main/resources/static/js/pages/adjust-contrast.js @@ -222,7 +222,7 @@ async function downloadPDF() { // Event listeners document.getElementById('fileInput-input').addEventListener('change', function (e) { - const fileInput = event.target; + const fileInput = e.target; fileInput.addEventListener('file-input-change', async (e) => { const {allFiles} = e.detail; if (allFiles && allFiles.length > 0) { diff --git a/src/main/resources/templates/convert/img-to-pdf.html b/src/main/resources/templates/convert/img-to-pdf.html index 758e83289..fa0fc74f2 100644 --- a/src/main/resources/templates/convert/img-to-pdf.html +++ b/src/main/resources/templates/convert/img-to-pdf.html @@ -17,7 +17,7 @@ image -
+
@@ -51,15 +51,18 @@