React-native-document-picker: After selecting a pdf file type is null

Created on 4 Sep 2017  路  9Comments  路  Source: rnmods/react-native-document-picker

When i choose pdf file from file manager type is null
devices tested: http://prntscr.com/ggxj1m, http://prntscr.com/ggxp89 and other devices the same issue
body of res: http://prntscr.com/ggxjar
maybe the same issue like here: https://github.com/Elyx0/react-native-document-picker/issues/56

FAQ

Most helpful comment

@Muran-Hu this is how I install v3 "npm i --save https://github.com/Elyx0/react-native-document-picker.git#v3"

All 9 comments

Which OS version/ Version of the lib?

@Elyx0 lib version is 2.0.0 and react-native v0.43.0

DocumentPicker.show({
filetype: [DocumentPickerUtil.images()],
},(error,res) => {
// Android
console.log(
res.uri,
res.type, // mime type
res.fileName,
res.fileSize
);
});

During my testing, the returned file info res.type is null. How to get the file type?

@Muran-Hu type is not implemented in iOS in v2, try the v3 branch.

OK, let me try. Thanks

How to install v3, i just tried "npm i --save [email protected]", but it does't work for me?
No matching version found for [email protected].

@Muran-Hu this is how I install v3 "npm i --save https://github.com/Elyx0/react-native-document-picker.git#v3"

@repapa Thanks. It works for me!

closing as resolved

Was this page helpful?
0 / 5 - 0 ratings