MiriK
January 12, 2018, 6:18am
1
Hi guys,
I have a problem with saving blob to my android device via cordova-plugin-file writeFile method. There is no problem in iOS and some Android devices.
async downloadLogbook(vehicle) {
try {
const data = await this.logbookProvider.getLogbookPdf(vehicle.id).toPromise()
const blob = new Blob([data._body], { type: 'application/pdf' })
const filename = 'logbook.pdf'
const opt: IWriteOptions = { replace: true }
await this.file.writeFile(this.file.dataDirectory, filename, blob, opt)
} catch (err) {
this.actionCtrl.showError(err)
}
method writeFile is not returning anything. No err, no Success
Any idea?
Thanks
@MiriK , were you able to find any solution for this issue? I’m facing the same problem on some android devices.
I have this same issue, base64 PDF converted into blob and the blob is written to filesystem , but the PDF file size is only zero bytes in Samsung and in some other smartphones, it works fine in Lenovo, pls advice in simple words , solution for this problem, the above fix is not undersatanable
anespa
March 16, 2018, 3:10am
7
@casperkotwal did you find solution ? If please help me to create a pdf file from base64 format and save it on mobile…
Waiting your fast reply
anespa
March 27, 2018, 8:47am
8
Thanks alot @casperkotwal
Your solution works at last …
Anes
MiriK
March 27, 2018, 12:45pm
9
@anespa Can you tell me the right procedure, please?
anespa
March 27, 2018, 1:02pm
10
As you said in index.html at /src i just put the polyfill.js file inclusion above the cordova.js file inclusion.
Thats all.