I'm trying to read a file with the HTML5 FileReader API. This works fine in Firefox 5.0 but no event is fired in Chromium 12.0.742.112
<html>
<head>
<script type="text/javascript">
function handle(evt) {
var reader = new FileReader();
var file = evt.files[0];
console.log("handling: " + file.name);
reader.onloadstart = function(e) { console.log("loadstart"); }
reader.onload = function(e) { console.log("onload"); console.log(e.target.result); };
reader.readAsText(file);
}
</script>
</head>
<body>
<input type="file" id="input" onchange="handle(this)">
</body>
</html>
Also the code given in this question Chrome FileReader is not working any more.
My grasp of HTML is rather crude and I cannot see what is wrong with those samples. Is this simply a Chromium bug or is Firefox non-conforming?
I can annotate the sample with ECMAScript5 passages, if this helps and makes things more clear.