How to get data in Base64 from input file data?
This is how we read the file data from the input form, how can I get Base64 from the fileList ?
HTML
<form action="upload.php" method="POST" id="uploadform"> <input id="uploadBtn" type="file" name="file"/> <input type="submit" value="Upload"/><br/><br/> </form> Js
var inputElement = document.getElementById("uploadBtn"); inputElement.addEventListener("change", handleFiles, false); function handleFiles() { var fileList = this.files; }