最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to read or download a file in React Native? - Stack Overflow

programmeradmin1浏览0评论

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.

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.

Share Improve this question asked Mar 15, 2017 at 9:29 Adam SanchoAdam Sancho 1872 gold badges3 silver badges13 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

For native filesystem managing (creation of local files, deletion etc) you could use this module, https://github./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.

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

发布评论

评论列表(0)

  1. 暂无评论