I found a piece of code that changes the img on display once you get a file for a preview. I understand everything except for the meaning of oFREvent. I've searched it up and have seen other people using it but can't find what it does. Is there an effect that it has that differs from anything else that could be there?
let oFReader = new FileReader();
oFReader.readAsDataURL(document.getElementById("uploadImage").files[0]);
oFReader.onload = function (oFREvent) {
document.getElementById("uploadPreview").src = oFREvent.target.result;
};
};
This is the html for the function
<input type="text" name="imgName"><br>
<input id="uploadImage" type="file" name="newImg" onchange="PreviewImage();">