please anyone help me to access device external memory(sd card) using Ionic-v4 and Angular 6 and platform is Android.
I have tried using Ionic native file, but it shows the path of Internal memory only.
// file system access
import { File } from '@ionic-native/file/ngx';
// file opener
import { FileOpener } from '@ionic-native/file-opener/ngx';
// document viewer
import { DocumentViewer, DocumentViewerOptions } from '@ionic-native/document-viewer/ngx';
............
let path = this.file.externalRootDirectory;
this.file.checkDir(path, 'mydir').then(_ => {
console.log('Directory exists');
this.showAlert('Directory exists','','Directory exists: '+path);
}).catch(err =>{
console.log('Directory doesnt exists');
this.showAlert('Directory doesnt exists','','Directory doesnt exists: '+path);
});
Then I tried getExternalSdCardDetails() method of cordova-diagnostic-plugin
import { Diagnostic } from '@ionic-native/diagnostic';
.........
this.diagnostic.getExternalSdCardDetails().then(obj => {
this.showAlert('xxxxxxxx','','xxxxxxxx: '+JSON.stringify(obj));
}, (errData)=>{
});
But it is not working.
I am new to Ionic, please anyone help to just read the external memory or sd-card in Ionic4 and angular6 for android platform. Thank you.