W3C / PhoneGap FileReader - how to use?

I work with PhoneGap (which implements the W3C FileReader to access the file) and there are tons of tutorials on the Internet, but they all seem to lead to a dead end. Basically, they show you how to set everything up, but in the end, they all get to the place where it says:

myReader.readAsText(file);

What I'm confused about is ... what exactly is this doing? Does it return some kind of index array? Can I use something along the while (! Feof) lines? How can I access what he just read?

+3
source share
1 answer

Here is a little more example:

var reader = new FileReader();
reader.onloadend = function(evt) {
    console.log("Read as data URL");
    console.log(evt.target.result);
};
reader.readAsText(file);

, FileEntry readAsText, , onloadend, . evt.target.result , .

+4

All Articles