I'm developing a file storage app that needs to read the contents of the sd-storage and internal phone storage. I've checked out react-native-fs and react-native-fetch-blob but both of these apps only allow me to access my app's storage. How can I read the other files present on the phone?
On Android devices, you will need to append "file://" to load any file. You can do this using the package you mentioned or just manually. If you append it manually, react-native-fs can then be used to read the URI.
log('mime type: ' + fileInfo. type); console. log('extension: ' + fileInfo. extension);
I believe react-native-fs does support external storage in Android.
From the documentation:
ExternalDirectoryPath
(String
) The absolute path to the external files, shared directory (android only)
ExternalStorageDirectoryPath
(String
) The absolute path to the external storage, shared directory (android only)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With