cordova-plugin-file icon indicating copy to clipboard operation
cordova-plugin-file copied to clipboard

readAsDataURL promise resolve with empty data at end of data:audio/mpeg;base64, in Android target API 30

Open vishal-revdiwala opened this issue 3 years ago • 2 comments
trafficstars

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

vishal-revdiwala avatar Aug 30 '22 09:08 vishal-revdiwala

same issue

Valdenirmezadri avatar Jan 18 '23 19:01 Valdenirmezadri

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)

breautek avatar Jan 24 '23 23:01 breautek