In my Ionic project I need to read a local txt file and convert it in an array at every "\n". I had a look at this answer, but I can't use the function since it tells me that readFile (or readFileAsync) is not a function.
I need to open it while running locally on my browser, not on device, so I'm not looking for a solution using cordova and ionic-native
-
1Use FileReader APIcharlietfl– charlietfl2017-11-24 16:10:49 +00:00Commented Nov 24, 2017 at 16:10
-
Hi, thanks, I can't find how to load the file from a path ... Every method needs a File or a Blob, but I don't know how to create themUsr– Usr2017-11-24 16:58:47 +00:00Commented Nov 24, 2017 at 16:58
-
Add a file input or drop zone in page or if file is on local server make ajax request and then you don't even need FileReader...just parse the textcharlietfl– charlietfl2017-11-24 17:36:20 +00:00Commented Nov 24, 2017 at 17:36
Add a comment
|