Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48980

Cannot read PDF, .Docx from Internal Storage using cordova.file.externalRootDirectory for Android 11

$
0
0

Not able to read PDF and .Docx files from location file:///storage/emulated/0/Download/. Also not able to read files recursively inside directories, Returning array length of ‘0’.

Please check this link:
https://github.com/apache/cordova-plugin-file/issues/508

Code

listFilesinFolder(folderName) {
this.file.listDir(this.file.externalRootDirectory, 'Download'+'/').then((filesList) => {
console.log('filesList-->', filesList);
if (filesList.length !== 0) {
Promise.all(filesList.map(async (file) => {
if (file.isDirectory) {
console.log('Directory', file);
this.listFilesinFolder(file.fullPath.substring(1));
} else if (file.isFile === true) {
console.log('file', file);
}
}
})));
}

Environment, Platform, Device

Android 11

Version information

@ionic-native/file”: “^5.36.0”,
“cordova-plugin-file”: “^6.0.2”,Preformatted text

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>