implemented file upload

This commit is contained in:
2021-08-06 13:59:01 +02:00
parent 713a96efc5
commit 318343e731
2 changed files with 26 additions and 3 deletions

View File

@@ -0,0 +1,17 @@
async function uploadFile(file:File,id: string): Promise<boolean> {
console.debug(file)
const res = await fetch(`/api/file?${new URLSearchParams({id:id}).toString()}`,{
method: "POST",
headers: {
"Content-Type": file.type
},
body: file
})
return res.status == 200
}
export default uploadFile