From 4a217863553d0f4e1b97067a14205f523967cda8 Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Sat, 23 Apr 2022 10:50:56 +0200 Subject: [PATCH] Fix multi file upload duplication --- s3file/static/s3file/js/s3file.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/s3file/static/s3file/js/s3file.js b/s3file/static/s3file/js/s3file.js index 4cd6aa5..bef5abb 100644 --- a/s3file/static/s3file/js/s3file.js +++ b/s3file/static/s3file/js/s3file.js @@ -94,12 +94,6 @@ hiddenFileInput.name = name hiddenFileInput.value = parseURL(result) form.appendChild(hiddenFileInput) - var hiddenSignatureInput = document.createElement('input') - hiddenSignatureInput.type = 'hidden' - hiddenSignatureInput.name = name + '-s3f-signature' - console.log(fileInput.dataset.s3fSignature) - hiddenSignatureInput.value = fileInput.dataset.s3fSignature - form.appendChild(hiddenSignatureInput) }) fileInput.name = '' window.uploading -= 1 @@ -132,6 +126,11 @@ hiddenS3Input.name = 's3file' hiddenS3Input.value = input.name form.appendChild(hiddenS3Input) + var hiddenSignatureInput = document.createElement('input') + hiddenSignatureInput.type = 'hidden' + hiddenSignatureInput.name = input.name + '-s3f-signature' + hiddenSignatureInput.value = input.dataset.s3fSignature + form.appendChild(hiddenSignatureInput) }) inputs.forEach(function (input) { window.uploading += 1