How to use the react-native-document-picker.pickMultiple function in react-native-document-picker

To help you get started, we’ve selected a few react-native-document-picker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github raindropio / mobile / src / screens / bookmark / add / home / file.js View on Github external
onPress = async ()=>{
        let files = []
        try{
            files = await DocumentPicker.pickMultiple({
                type: [
                    DocumentPicker.types.images,
                    DocumentPicker.types.pdf,
                    DocumentPicker.types.plainText,
                    DocumentPicker.types.video,
                    ...Platform.select({
                        ios: ['com.microsoft.word.doc', 'com.microsoft.excel.xls', 'com.microsoft.powerpoint.​ppt', 'org.openxmlformats.wordprocessingml.document', 'org.openxmlformats.spreadsheetml.sheet', 'org.openxmlformats.presentationml.presentation', 'org.openxmlformats.presentationml.slideshow'],
                        android: ['application/*']//doc,etc...
                    })
                ],
            })
        }catch(e){}

        if (!files.length)
            return