pwlin / cordova-plugin-file-opener2

A File Opener Plugin for Cordova
MIT License
314 stars 587 forks source link

Can not display PDF (format invalid) on Android using filetransfer cordovaplugin #288

Closed hathemi closed 4 years ago

hathemi commented 4 years ago

i get pdf file from web service and i want to download it and open it in my android device. using this code

fileTransfer.download(url,this.file.externalDataDirectory+ filename).then((entry) => { this.localNotifications.schedule({ text: ‘Téléchargement de fichier’+filename+’ est terminé !!’, led: ‘FF0000’, sound: null });

download the pdf file but connot open it because it has been saved as “error :invalid format” !!!with size 0. any solution or suggestion please!

pawelzwronek commented 4 years ago

For me looks like problem with filetransfer plugin. Try post as issue here.

pwlin commented 4 years ago

@hathemi yes as pawelzwronek mentioned, this issue is related to cordova-plugin-filetransfer. And don't forget to add Cordova File Plugin to your project otherwise this.file.externalDataDirectory will not work.