lib/script.js
function uploadHandler (event) {
    const target = event.target;

    if (target.files && target.files[0]) {
      file = target.files[0];
      const reader = new FileReader();

      reader.addEventListener('load', loadHandler);

      reader.readAsDataURL(file);
    }
  }
function uploadHandler (event) {
    const target = event.target;

    if (target.files && target.files[0]) {
      file = target.files[0];
      const reader = new FileReader();

      reader.addEventListener('load', loadHandler);

      reader.readAsDataURL(file);
    }
  }
function uploadHandler ( event ) { const target = event . target ; if ( target . files && target . files [ 0 ] ) { file = target . files [ 0 ] ; const reader = new FileReader ( ) ; reader . addEventListener ( 'load' , loadHandler ) ; reader . readAsDataURL ( file ) ; } }
Upload handler for file upload element
@param  {[type]} event - handler executed when the load event is fired
Upload handler for file upload element