cordova - Read text file on Android with Phonegap -


i trying read text file on android phonegap. have looked @ of examples , don't see difference in code. file has lines of text. onloadend results in length of 0. there no errors. missing here?

    function readtextfile(filename) {                                window.requestfilesystem(localfilesystem.temporary, 5*1024*1024,        successcallback, errorcallback);                                function successcallback(fs) {                                    fs.root.getfile(filename, {}, function(fileentry) {                                        fileentry.file(function(file) {                                            var reader = new filereader();                                            reader.onloadend = function(e) {                                                console.log("text file length: " + this.result.length);                                            };                                            reader.readastext(file);                                        }, errorcallback);                                    }, errorcallback);                                }                                 function errorcallback(error) {                                    console.log("error: " + error.code);                                }    } 


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -