we are using react-native-fs for android 11. i have the problem that i can't save Pfd and Excel files on the Downloads folder (/storage/emulated/0/Download) anymore, because we edit the files via other apps and then upload the file again in our app. I know that from Android 11 the storage accesses have changed and it is only possible on the so called scope storage. Is there with react-native-fs or somehow also different (via React Native) to store the files so that also other apps can see the files or you can open them in the file explorer of Android or see them like a shared folder for all apps. There is also the possibility with MANAGE_EXTERNAL_STORAGE but this setting is reserved for certain apps only according to Android.
React native version: 64.2 react-native-fs: 2.18.0 Andriod 11
Thanks in advance
// /storage/emulated/0/Download/E-Akte_Schadenformular_2020.xlsx
path = RNFS.DownloadDirectoryPath + '/' + dataBezeichnung + '.' + data.dateityp;
console.log('RNFS.DownloadDirectoryPath');
console.log(path);
// write the file
RNFS.writeFile(path, meThis.state.dateiBase64, 'base64').then((success) => {
console.log('Datei Erfolgreich Runtergeladen!');
Functions.toast("ERFOLGREICH", "Runterladen erfolgreich \n\nDie Datei:\n" + dataBezeichnung + '.' + data.dateityp+ "\n\nwurde auf Ihrem Gerät erfolgreich gespeichert", 10000);
}).catch((err) => {
Functions.toast("WARNUNG", "Runterladen nicht möglich, um die Datei auf Ihrem Gerät zu speichern, müssen Sie die Berechtigung für die eSASSApp aktivieren unter\n\nGeräteeinstellungen -> Apps -> eSASSAPP -> Berechtigungen -> Dateien und Medien -> (Android bis 10 : Zugriff nur auf Mediendateien zulassen) Oder (Ab Andriod 11: Verwaltung aller Dateien zulassen)", 10000);
console.log(err.message);
});
Error Message:
ENOENT: open failed: EACCES (Permission denied), open '/storage/emulated/0/Download/E-Akte_Schadenformular_2020.xlsx'