My code is available at the following link: https://codepen.io/manuchadha/pen/PBKYBJ
In this form I have created, I am trying to implement an image upload feature using a file input. The goal is to display a thumbnail of the selected image below the file selector along with a close (x) sign on the top-right corner for deleting the image. However, I seem to be encountering challenges in achieving this functionality. Can anyone assist me in identifying what may be going wrong?
Below is the HTML snippet:
<!DOCTYPE html>
<html lang="en">
...
CSS:
body{
margin:0px;
}
...
JS:
function handleFileSelect(){
console.log("got file upload event:");
...
}
function _handleReaderLoaded(readerEvt) {
var binaryString = readerEvt.target.result;
var base64textString= btoa(binaryString);
...
}