prevent file duping
This commit is contained in:
parent
f68303263f
commit
b89209fa5a
1 changed files with 5 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue