React native download large files
I tried downloading the file using browser, it takes a while to start the download since the server collects all the files and puts inside zip. But the browser waits for the server till the file is available and completes the download.
But in case of react-native-fetch-blob the download doesn't wait till the server responds completely. The download stops and starts again. The cycle keeps on going! Add a comment. Active Oldest Votes. You need to set the connection timeout then. Bojan Petkovic Bojan Petkovic 2, 13 13 silver badges 25 25 bronze badges. The fetch does not support timeout feature.
And the react-native-fetch-blob's config object does not seem to accept timeout property. How do I made the download manager wait till the server serves the file? Headers given in the download function are merged with the ones given in setHeaders. Checks for downloads that ran in background while you app was terminated. Recommended to run at the init stage of the app. DownloadTask[] - Array of tasks that were running in the background so you can re-attach callbacks to them.
A class representing a download task created by RNBackgroundDownloader. All callback methods return the current instance of the DownloadTask for chaining. An absolute path to the app's documents directory. It is recommended that you use this path as the target of downloaded files. Developed by Elad Gil of Eko. Skip to content. Star View license. Collectives on Stack Overflow.
Learn more. How to download a file with React Native? Ask Question. Asked 4 years, 5 months ago. Active 5 months ago. Viewed 83k times. I added android. I double-checked that the file I am trying to download exists when it does not, the library throws an error I do not find other solutions for this problem.
Arnaud Arnaud 4, 14 14 gold badges 46 46 silver badges 82 82 bronze badges. Add a comment. Active Oldest Votes. Just implemented the download feature an hour ago :p Follow these steps: a npm install rn-fetch-blob b follow the installation instructions.
You can check the available directories in the wiki. Jonathan Simonney 1 1 gold badge 9 9 silver badges 22 22 bronze badges. The problem is, where do the file stored? I just console. React-native-fetch-blob object callback. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. React-native-fetch-blob downloading file Ask Question. Asked 4 years, 5 months ago.
Active 2 years, 5 months ago.