Skip to content

Instantly share code, notes, and snippets.

@jacobtwlee
Last active January 15, 2017 15:12
Show Gist options
  • Save jacobtwlee/5bd9dd74cad25d4b94cc to your computer and use it in GitHub Desktop.
Save jacobtwlee/5bd9dd74cad25d4b94cc to your computer and use it in GitHub Desktop.
Reading the file
function readFile(file) {
var reader = new FileReader();
reader.onloadend = function () {
processFile(reader.result, file.type);
}
reader.onerror = function () {
alert('There was an error reading the file!');
}
reader.readAsDataURL(file);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment