📅  最后修改于: 2022-03-11 15:03:43.435000             🧑  作者: Mango
let photo = document.getElementById("image-file").files[0]; // file from input
let req = new XMLHttpRequest();
let formData = new FormData();
formData.append("photo", photo);
req.open("POST", '/upload/image');
req.send(formData);