Answers for "set file upllaod via javascript to html input"

0

set file upllaod via javascript to html input

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);
Posted by: Guest on February-06-2021

Code answers related to "set file upllaod via javascript to html input"

Code answers related to "Javascript"

Browse Popular Code Answers by Language