forked from oat/in-the-database-2
23 lines
470 B
HTML
23 lines
470 B
HTML
<html>
|
|
<head>
|
|
<title>file upload</title>
|
|
<script>
|
|
async function upload() {
|
|
let file = document.getElementById('file');
|
|
|
|
console.log(file.files[0]);
|
|
|
|
await fetch('/upload', {
|
|
method: 'POST',
|
|
body: file.files[0]
|
|
});
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<form method="post" encType="multipart/form-data">
|
|
<input type="file" name="file" id="file"><br>
|
|
<input type="submit" value="upload" onclick="upload()">
|
|
</form>
|
|
</body>
|
|
</html> |