prevent file duping
This commit is contained in:
parent
3109c791f1
commit
dc01beac8c
1 changed files with 5 additions and 1 deletions
|
@ -3,9 +3,13 @@ async function formClick(ev) {
|
||||||
|
|
||||||
let { target } = ev;
|
let { target } = ev;
|
||||||
|
|
||||||
|
let fData = new FormData(target);
|
||||||
|
|
||||||
|
target.querySelector('input[type=file]').value = null;
|
||||||
|
|
||||||
let fetched = await fetch(target.action, {
|
let fetched = await fetch(target.action, {
|
||||||
'method': 'POST',
|
'method': 'POST',
|
||||||
'body': new FormData(target)
|
'body': fData
|
||||||
});
|
});
|
||||||
|
|
||||||
let json = await fetched.json();
|
let json = await fetched.json();
|
||||||
|
|
Loading…
Reference in a new issue