
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
react-native-file-selector-fix
Advanced tools
ReactNative: Native File Selector (Android/iOS)
If this project has helped you out, please support us with a star 🌟 New fix for react-native 0.63.2
This library is a ReactNative Bridge around native libraries. It allows you to natively select/pick file from device file system:
| Android: nbsp-team/MaterialFilePicker/ |
|---|
![]() |
Note: It allows you to pick file without using Intent/Third Party Software
| iOS: marmelroy/FileBrowser |
|---|
Note: It allows you to select only local files associate to app sandbox.
$ npm install react-native-file-selector --save
RN60 above please use
react-native-file-selectorV1 and above
iOS Prerequisite: Please make sure
CocoaPodsis installed on your system
- Add the following to your `Podfile` -> `ios/Podfile` and run pod update:
use_native_modules!
pod 'RNFileSelector', :path => '../node_modules/react-native-file-selector/ios'
use_frameworks!
pod 'FileBrowser', :git => 'https://github.com/prscX/FileBrowser'
Android
Add below snippet in your app build.gradle file
allprojects {
repositories {
maven {
url "http://dl.bintray.com/lukaville/maven"
}
...
}
}
res/color.xml. You can provide your own color codes <color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
RN60 below please use
react-native-file-selectorV.0.*
$ react-native link react-native-file-selector
build.gradle filerepositories {
maven {
url "http://dl.bintray.com/lukaville/maven"
}
maven { url "https://maven.google.com" }
...
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven { url "https://maven.google.com" }
...
}
}
Note: This library is supported Android 27 > above
res/color.xml. You can provide your own color codes <color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
After react-native link react-native-file-selector, please verify node_modules/react-native-file-selector/ios/ contains Pods folder. If does not exist please execute pod install command on node_modules/react-native-file-selector/ios/, if any error => try pod repo update then pod install
After verification, open your project and create a folder 'RNFileSelector' under Libraries.
Drag node_modules/react-native-file-selector/ios/pods/Pods.xcodeproject into RNFileSelector, as well as the RNFileSelector.xcodeproject if it does not exist.
Add the FileBrowser.framework into your project's Embedded Binaries and make sure the framework is also in linked libraries.
Go to your project's Build Settings -> Frameworks Search Path and add ${BUILT_PRODUCTS_DIR}/FileBrowser non-recursive.
Add below snippet in your app AppDelegate.m. This basically adds navigation controller in order to push list of files screen
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
navigationController.navigationBar.hidden = YES;
self.window.rootViewController = navigationController;
// self.window.rootViewController = rootViewController;
import RNFileSelector from 'react-native-file-selector';
RNFileSelector.Show(
{
title: 'Select File',
onDone: (path) => {
console.log('file selected: ' + path)
},
onCancel: () => {
console.log('cancelled')
}
}
)
<RNFileSelector title={"Select File"} visible={this.state.visible} onDone={() => {
console.log("file selected: " + path);
}} onCancel={() => {
console.log("cancelled");
}}/>
| Prop | Type | Default | Note |
|---|---|---|---|
title | string | Title on the toolbar | |
closeMenu | string | true | Color of tint |
hiddenFiles: Android | bool | false | If true it shows hidden files as well |
path | string | Path of directory | |
filter | string | Filter to sort the files | |
filterDirectories: Android | bool | Filter should be applied on directories or not | |
onDone | func | Function called when file is selected | |
onCancel | func | Function called when file selector is closed without selecting any file | |
visible | bool | false | To invoke file selector |
Note
- Filter
- Android: Please find regex/Pattern for defining filter
- iOS: Array of file extension needs to be ignore
Have an idea? Found a bug? Please raise to ISSUES. Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.
If you are using this library in one of your projects, add it in this list below. ✨
This library is provided under the Apache License.
RNFileSelector @ prscX
I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Starring and sharing the projects you like 🚀
If you're feeling especially charitable, please follow prscX on GitHub.
Thanks! ❤️
prscX.github.io
</ Pranav >
FAQs
React Native: Native File Selector
We found that react-native-file-selector-fix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.