I am using rn-fetch-blob package to download files with any file to my device from an api call. I gave specific download path if the app is being used in android. If the app is being used in iOS, I specified the path as RNfetchblob.dirs.DocumentsDir+/filename/. The downloaded files can be viewed in file manager in android. But in iOS, as there is no concept of file manager, where should I be able to view the downloaded files. Thanks in advance.
Asked
Active
Viewed 1,090 times
1 Answers
0
On iOS you cannot directly view a file, as there's no official file manager letting you do such a thing.
If you have downloaded something like an image, you can still access it and use them in your components.
For example, an image using the rnfetchBlob file would be:
<Image source {{Platform.OS === 'ios'?RNfetchblob.dirs.DocumentsDir + /filename + '.' + extension:
"file://"+ RNfetchblob.dirs.DocumentsDir + /filename + '.' + extension}}

Auticcat
- 4,359
- 2
- 13
- 28
-
Thank you for the solution. But, what if the downloaded file is of type other than image(i.e., pdf, mp3, mp4, etc) – Anurag Mantripragada Jun 30 '19 at 14:18
-
It's the same for video files, and I think it's the same with other files, so It shouldn't be a problem – Auticcat Jul 01 '19 at 06:34
-
Hey @Auticcat can you check [this](https://stackoverflow.com/questions/60459901/download-audio-file-in-react-native) question, please? – Oliver D Feb 28 '20 at 22:43
-
@Auticcat Then How Google chrome in Ios Downloads files to the public Directory ?? – Arunkumar K Jul 31 '20 at 12:00