prevent file duping

This commit is contained in:
biglyderv 2024-09-20 15:34:16 -04:00
parent f68303263f
commit b89209fa5a
No known key found for this signature in database
GPG key ID: 33AC87E9ACE66954

View file

@ -3,9 +3,13 @@ async function formClick(ev) {
let { target } = ev;
let fData = new FormData(target);
target.querySelector('input[type=file]').value = null;
let fetched = await fetch(target.action, {
'method': 'POST',
'body': new FormData(target)
'body': fData
});
let json = await fetched.json();