1let photo = document.getElementById("image-file").files[0]; // file from input
2let req = new XMLHttpRequest();
3let formData = new FormData();
4
5formData.append("photo", photo);
6req.open("POST", '/upload/image');
7req.send(formData);
8