Skip to content

Instantly share code, notes, and snippets.

@ukyo ukyo/fileio.html
Last active Dec 16, 2015

Embed
What would you like to do?
<!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
You can’t perform that action at this time.