Skip to content

Content URI directory support #1074

@LitileXueZha

Description

@LitileXueZha

When I pick a single file, it works fine:

const res = await DocumentPicker.pick();
const content = await fs.readFile(res[0].uri);
// good

When I pick a directory, it does not work:

const res = await DocumentPicker.pickDirectory();
const dirs = await fs.readDir(decodeURIComponent(res.uri)); // decode the uri or it will throw a unsupported error
// not worked, throw a error: Permission Denial...ACTION_OPEN_DOCUMENT...

I see the same problem in this PR, but I don't konw how to do.

Environments:

Android 8.0
react-native@0.66.0
react-native-fs@2.18.0
react-native-document-picker@7.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions