android - Cordova-plugin-file-transfer FileTransfer download error code 3 - handshake failed in ionic application -
in ionic application error when try download pdf document our server using cordova file transfer plugin:
code snippet
public getdocument(url: string, filepath: string, filename: string): promise<boolean> { const filetransfer = new transfer(); let headers = this.createheader(); let requestoptions = new requestoptions({headers: headers}); return this.documentpromise = new promise((resolve, reject) => { filetransfer.download(url, filepath + filename, true, requestoptions) .then((entry) => { resolve(entry.tourl()); }) .catch((error) => { reject(error); }); it jumps directly catch case , gives following
error
json.stringify(error) >> "code": 3, "source": "https://asd.mysite.de/proxy/bill/app/pdfdocument", "target": "file:///storage/emulated/0/android/data/subdomain.domainname.toplevdomain/files/document.pdf" "http_status": null, "body": null, "exception": "handshake failed" the "source" path reachable , , file downloadable other devices. on phone there exists path "/storage/emulated" , rest of path never created.
this happens on samsung a3 latest android version , on new huawei phone, not on other android phones or ios.
any ideas on why error might occur?
this running system:
cli packages: (d:\users\...) @ionic/cli-utils : 1.9.2 ionic (ionic cli) : 3.9.2 global packages:
cordova cli : 7.0.1 local packages:
@ionic/app-scripts : 2.1.3 cordova platforms : android 6.2.3 browser 4.1.0 ionic framework : ionic-angular 3.6.0 system:
android sdk tools : 26.0.2 node : v6.11.0 npm : 5.3.0 os : windows 7 the relevant plugins set version:
"cordova-plugin-file": "^4.3.3", "cordova-plugin-file-opener2": "^2.0.19", "cordova-plugin-file-transfer": "^1.6.3", "cordova-plugin-whitelist": "^1.3.1",
Comments
Post a Comment