reading file upload in javascript

Subject:

file = this;

if (file.files && file.files[0]){    var reader = new FileReader();    reader.onload = imageIsLoaded;    reader.readAsDataURL(file.files[0]);}function imageIsLoaded(e){  console.log(e);  console.log(e.target.result);    $('#header-image-preview').show()    $('#header-image-preview').find('img').attr('src', e.target.result);};

2018-03-24 13:05:25gstlouis