Created
December 1, 2014 14:18
-
-
Save westc/fec8406b1f8c62cc31f6 to your computer and use it in GitHub Desktop.
Read file as text in Chrome app.
This file contains hidden or 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
| function readFileAsText(fileEntry, callback) { | |
| fileEntry.file(function(file) { | |
| var reader = new FileReader(); | |
| reader.onload = function(e) { | |
| callback(e.target.result); | |
| }; | |
| reader.readAsText(file); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment