regulaforensics / DocumentReader-Cordova-Plugin

Cordova plugin for reading and validation of identification documents
https://mobile.regulaforensics.com/
4 stars 4 forks source link

while reading licence i am facing error in Ionic 5 Error: Uncaught (in promise): FileError: {"code":5,"message":"ENCODING_ERR"} #8

Closed Muhammad-Afzal-payactiv closed 3 years ago

Muhammad-Afzal-payactiv commented 3 years ago

Any one help to resolve this issue

Muhammad-Afzal-payactiv commented 3 years ago

i got the solution this one is solution try { // console.log( "converted",this.webview.convertFileSrc(uri)); (window as any).resolveLocalFileSystemURL(this._file.applicationDirectory + "www/regula.license", (fileEntry) => {fileEntry.file( (file) => { var reader = new FileReader(); reader.onloadend = (evt) => { let base64String = evt.target.result; }; reader.readAsArrayBuffer(file); });}, function(e){console.log("error:" + JSON.stringify(e));}); } catch (error) { console.log('NativeUploaderByURI:',error); }