read file with filereader javascript code example
Example: filereader javascript example
//HTML
<input type='file' accept='image/*' onchange='openFile(event)'><br>
<img id='output'>
//Javascript
var openFile = function(event) {
var input = event.target;
var reader = new FileReader();
reader.onload = function(){
var dataURL = reader.result;
var output = document.getElementById('output');
output.src = dataURL;
};
reader.readAsDataURL(input.files[0]);
}