Skip to content
Snippets Groups Projects
Commit 023dd900 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Improved upload API

parent 735a674a
No related branches found
No related tags found
No related merge requests found
......@@ -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) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment