I have the following javascript example: https://jsfiddle.net/rdqwnd9n/
It consists of a file upload element, and an image element, with the following javascript code:
var input = document.querySelector('input');
var readFiles = function(){
  var reader = new FileReader();
  reader.readAsDataURL(files[0]);
  console.log(reader.result);
  var img = document.querySelector('img');
  img.src = reader.result;
}
I read the uploaded file as a dataURL, then feed that (assumedly) picture back to an image element. What am I missing here?