Fix missing info in form data

This commit is contained in:
Reece Browne
2024-12-18 00:16:01 +00:00
parent e273b9a3ad
commit e9f80d03ea
3 changed files with 44 additions and 8 deletions

View File

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

View File

@@ -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) {