0

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

3
  • 1
    Use FileReader API Commented 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 them Commented 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 text Commented Nov 24, 2017 at 17:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.