Last active
December 16, 2015 20:39
-
-
Save ukyo/5494035 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>fileio</title> | |
</head> | |
<body> | |
<input type="file"> | |
<script src="file.js"></script> | |
<script> | |
window.onload = function() { | |
var fileInput = document.querySelector('input'); | |
fileInput.addEventListener('change', function(e) { | |
var file = e.target.files[0]; | |
var reader = new FileReader; | |
reader.readAsArrayBuffer(file); | |
reader.onload = function() { | |
console.log(fileio(reader.result)); | |
}; | |
}, false); | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment