I need to send one specific image in a form. I mean, there isn't a file picker. I need to use a hidden input to save an image like example.com/myimage.jpg and send it to the form like any other file. I can't change the backend.
var img = new XMLHttpRequest();
img.open("get","favicon.ico",false);
img.send();
document.getElementsByName("image")[0].value=img.response;
//This doesn't work
//The image isn't handle like it does with other files
<form method="POST" enctype="multipart/form-data">
<input name="image" type="hidden" value="IMAGE-HERE">
<input type="submit" value="submit">
</form>