cordova-plugin-file
cordova-plugin-file copied to clipboard
readAsDataURL promise resolve with empty data at end of data:audio/mpeg;base64, in Android target API 30
Bug Report
Problem
What is expected to happen?
It should read file data and append after data:audio/mpeg;base64, this.
What does actually happen?
It returns only string: data:audio/mpeg;base64, there is no file base64 data.
Information
Command or Code
this.audioFilePath = this.platform.is('ios') ? this.file.dataDirectory : this.file.externalDataDirectory;
this.file.readAsDataURL(this.audioFilePath, fileName).then(base64 => { console.log("Base64 DATA: ", base64); }).catch(error => { console.log("Base64 ERROR: ", error); });
Environment, Platform, Device
"cordova-android": "^10.1.0", "@ionic/angular": "^4.0.0", "cordova-plugin-file": "^7.0.0", "@angular/common": "^7.2.2", "@angular/core": "^7.2.2",
Version information
Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
same issue
Unable to reproduce with a pure cordova app.
Can a minimal reproduction app can be provided? It should not include frameworks, just a pure cordova app.
I've tested loading from:
- internal storage, like the application directory
- external storage like the downloads directory (written by another app), permission denied as expected
- external storage like the external application's data directory (used the file API to copy the sound file, then read from it)