Commit 023dd900 authored by Janne Koschinski's avatar Janne Koschinski

Improved upload API

parent 735a674a
......@@ -44,9 +44,14 @@
img.src = e.target.result;
node.appendChild(img);
results.appendChild(node);
const data = new FormData();
data.append("file", file);
fetch("/upload", {
method: "POST",
credentials: "same-origin"
credentials: "same-origin",
body: data
}).then((response) => {
return response.json()
}).then((json) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment