@Dovel wrote:
Is there a known issue of the FileReader in Ionic? In my case the FileReader is sometimes not responding.
let obj = { hello: 'world' }; let json = JSON.stringify(obj, null, 2); let blob = new Blob([json], { type: 'application/json' }); let readBlob = function (data) { let reader = new FileReader(); reader.onload = () => { console.log('Loaded: ', reader.result); }; reader.onerror = error => { console.log('Error: ', error); }; reader.onabort = () => { console.log('Aborted'); }; reader.readAsText(data); }; readBlob(blob);
I wrapped the code in try-catch and print every single step. Sometimes there is no reaction of the FileReader. No event is fired. No errors.
Device: Android (5.1) Ionic: ionic (Ionic CLI) : 4.0.6 Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.1.9 Cordova: cordova (Cordova CLI) : 8.0.0 Cordova Platforms : android 7.1.1 System: Android SDK Tools : 26.1.1 NodeJS : v8.11.3 npm : 5.6.0 OS : Windows 10
Posts: 1
Participants: 1