get rid of multipart in /msd/write

This commit is contained in:
Maxim Devaev
2021-07-28 14:58:10 +03:00
parent 801b290ac6
commit 9aa3998924
3 changed files with 5 additions and 39 deletions

View File

@@ -99,16 +99,11 @@ export function Msd() {
};
var __clickUploadNewImageButton = function() {
let form_data = new FormData();
form_data.append("image", __image_file.name);
form_data.append("size", __image_file.size);
form_data.append("data", __image_file);
__upload_http = new XMLHttpRequest();
__upload_http.open("POST", "/api/msd/write", true);
__upload_http.open("POST", `/api/msd/write?image=${encodeURIComponent(__image_file.name)}`, true);
__upload_http.upload.timeout = 15000;
__upload_http.onreadystatechange = __uploadStateChange;
__upload_http.send(form_data);
__upload_http.send(__image_file);
};
var __uploadStateChange = function() {