Skip to content

Instantly share code, notes, and snippets.

@ysasaki
Created July 15, 2014 07:57
Show Gist options
  • Save ysasaki/5749618d2718b7e887ec to your computer and use it in GitHub Desktop.
Save ysasaki/5749618d2718b7e887ec to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<input id="file" type="file" name="file">
<script>
var reader = new FileReader;
reader.onload = function(e) {
console.log(e.target.result);
};
var input = document.getElementById('file');
input.addEventListener('change', function() {
reader.readAsBinaryString(this.files[0]);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment