React Native 的最佳文件选择器
Best file picker for react native
我已经尝试过 react-native-file-picker、react-native-file-chooser、react-native-document-chooser 等,但是 none 它们都可以正常工作。谁能给我推荐一个功能强大的文件选择器,用于从设备存储中选择文件?
个人意见,我用react-native-document-picker
。
installation and the usage is well mentioned in their docs
现在它支持 file upload
所需的大多数一般用例
- 所有类型的文件 'public.allFiles' 或
DocumentPickerUtil.allFiles()
- 仅 PDF 'public.pdf' 或
DocumentPickerUtil.pdf()
- 音频'public.audio'或
DocumentPickerUtil.audio()
- 纯文本 'public.plainText' 或
DocumentPickerUtil.plainText()
可以根据您的 file type option
修改其余限制,因为它提供了以下 file res
选项
res.uri,
res.type, // mime type
res.fileName,
res.fileSize
我使用react-native-file-picker,因为它可以select phone中的所有文件。
但是 react-native-document-picker 的文件数量非常有限 select
我已经尝试过 react-native-file-picker、react-native-file-chooser、react-native-document-chooser 等,但是 none 它们都可以正常工作。谁能给我推荐一个功能强大的文件选择器,用于从设备存储中选择文件?
个人意见,我用react-native-document-picker
。
installation and the usage is well mentioned in their docs
现在它支持 file upload
- 所有类型的文件 'public.allFiles' 或
DocumentPickerUtil.allFiles()
- 仅 PDF 'public.pdf' 或
DocumentPickerUtil.pdf()
- 音频'public.audio'或
DocumentPickerUtil.audio()
- 纯文本 'public.plainText' 或
DocumentPickerUtil.plainText()
可以根据您的 file type option
修改其余限制,因为它提供了以下 file res
选项
res.uri,
res.type, // mime type
res.fileName,
res.fileSize
我使用react-native-file-picker,因为它可以select phone中的所有文件。 但是 react-native-document-picker 的文件数量非常有限 select