Can't get path for directory
gj94gj94ao4 opened this issue · 2 comments
gj94gj94ao4 commented
Work fine with react-native-document-picker
to pick files and get their path.
but can't get path for a directory.
const path = await pickDirectory()
if (path !== null) {
const realPath = getPath(path.uri);
// Error: Exception in HostFunction: java.lang.UnsupportedOperationException: Unsupported Uri
// content://com.android.externalstorage.documents/tree/primary%3A...
console.log(realPath);
}
demchenkoalex commented
See #18 I think maybe this library is not needed at all now. I am not an Android developer, and only found this solution to pick files somewhere, not sure I will be able to adapt to directories as well.
demchenkoalex commented
rnmods/react-native-document-picker#70 (comment) also mentioned in the README of the document picker repo as well, is the correct way to retrieve the path. This repo will be archived.