Not able to open the DocumentDirectoryPath in react native

49 views Asked by At

Android 13 - OS Specific issue

I have download the zip file in DocumentDirectoryPath but when i am trying to open the file with different solution i am not able to open it.

Solution - 1. await Linking.openURL(⁠ file://${zipFilePath} ⁠, mimeType);

-- Lining is a facility in RN to open the file manager. But getting error Unable to open file manager for BineryDocument.zip I cross verified file exists

Solution - 2. React-native-intent-launcher try to use the package but it also not able to open the our zip file. Also this package have very less download

await IntentLauncherAndroid.startActivity({
    action: IntentLauncherAndroid.ACTION_VIEW,
    data: 'file:///path/to/your/file',
    type: 'application/your-mime-type',
});

Solution - 3 react-native-file-viewer try to use the package but it also not able to open the our zip file.

try {
    await FileViewer.open(filePath, { showOpenWithDialog: true });
} catch (error) {
    console.error('Error opening file:', error);
}

Destination path

/data/user/0/co.binery.app/files/BineryDocument.zip
0

There are 0 answers