-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (33 loc) · 909 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<input type="file"/>
<script>
function doPost(){
var input = document.querySelector('input[type="file"]')
fetch("/api/file", {
method: 'POST',
body: input.files[0]
})
}
function doPost2(){
var input = document.querySelector('input[type="file"]')
fetch("/api/array", {
method: 'POST',
body: input.files[0]
})
}
</script>
<div>
hello
<button onclick ="doPost()">
SEND FILE
</button>
<button onclick ="doPost2()">
SEND FILE 2
</button>
</div>
</body>
</html>