FUCK
This commit is contained in:
parent
0644f034a8
commit
f3935a8f0c
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
uid=$(/usr/bin/id -u) gid=$(/usr/bin/id -g) docker compose up --build
|
|
@ -0,0 +1 @@
|
|||
this is a data folder! the program is able to store specific data in here, and I'm not sure if git will push an empty folder.
|
|
@ -0,0 +1 @@
|
|||
this is a data folder! the program is able to store specific data in here, and I'm not sure if git will push an empty folder.
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>image test</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form id="image-form">
|
||||
<input type="file" name="file" accept="image/png">
|
||||
<input type="submit" name="submit" value="submit">
|
||||
</form>
|
||||
</body>
|
||||
<script defer>
|
||||
document.getElementById("image-form").addEventListener("submit", async (event) => {
|
||||
event.preventDefault();
|
||||
// this doesn't work
|
||||
// const file = event.target.files[0];
|
||||
// console.log(file)
|
||||
|
||||
var input = document.querySelector('input[type="file"]')
|
||||
console.log(input.files[0])
|
||||
|
||||
const token = await fetch("http://127.0.0.1:8000/upload", {
|
||||
method: "POST",
|
||||
header: {
|
||||
"Content-Type": "image/png",
|
||||
"Access-Control-Allow-Origin": "http://127.0.0.1:8000/upload"
|
||||
},
|
||||
body: input.files[0]
|
||||
})
|
||||
alert(await token.text());
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue