Skip to content

Commit

Permalink
Merge pull request #17 from TuringCup/feature_backend
Browse files Browse the repository at this point in the history
Feature backend
  • Loading branch information
deltaLRD authored Oct 15, 2023
2 parents 22d2d0b + 2eb4f50 commit 2f83a8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/user/upload/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ function upload_file(input: HTMLInputElement, setUploadState: (ok:boolean, msg:
let value = input.files.item(0);
if (value) {
let form = new FormData();
form.append("token", getCookie("token") as string);
form.append("file", value);
value.arrayBuffer().then(file => {
fetch("/api/uploadFile?name=" + value?.name, {
fetch("http://49.234.15.205:5001/api/user/upload" + value?.name, {
method: "POST",
body: form
}).then(e => e.json())
Expand Down

0 comments on commit 2f83a8d

Please sign in to comment.