Reputation: 187
I have a React-Native project and I need to read the data from a file which is on Internet, so, I need to read the data from the URL or download the file, read it and then delete the file.
Can anyone help me?
Thank you.
Upvotes: 1
Views: 11199
Reputation: 1889
For native filesystem managing (creation of local files, deletion etc) you could use this module, https://github.com/johanneslumpe/react-native-fs
For downloading/uploading you could either use the react native fetch
https://facebook.github.io/react-native/docs/network.html
or the above fs module.
Upvotes: 2
Reputation: 1829
React Native provides the Fetch API for your networking needs. Fetch will seem familiar if you have used XMLHttpRequest or other networking APIs before. You may refer to MDN's guide on Using Fetch for additional information.
https://facebook.github.io/react-native/docs/network.html
Upvotes: 1