apache / apache/cordova-plugin-file-transfer

Downloaded file got in 0 Bytes

Open
#246 11 comments 0 reactions 0 assignees View on GitHub
support
Dominant language
JavaScript
Stars
606
Forks
874
PR merge metrics
No merged PRs in 30d

Description

Using Ionic 3.20.1 and node 10.16.3
android platform
let uri = 'server url using https';
let dir = this.file.externalRootDirectory+'AppName/Documents/';
this.platform.ready().then(() => {
const fileTransfer: FileTransferObject = this.transfer.create();
fileTransfer.download(uri,dir+'filename.pdf').then((entry: Entry) => {
var fileEntry = entry as FileEntry;
console.log(fileEntry);
}, (error) => {
});
});

My file has been downloaded but got 0 Bytes size
I don't know what happen?
i am using these versions
"@ionic-native/file": "^4.20.0",
"@ionic-native/file-chooser": "^4.18.0",
"@ionic-native/file-opener": "^4.20.0",
"@ionic-native/file-path": "^4.20.0",
"@ionic-native/file-picker": "^4.18.0",
"@ionic-native/file-transfer": "^4.20.0",
Please help

Contributor guide

Open the contributing guide

Research direction

Start with the fileTransfer.download call and its empty error callback, then inspect the Android download behavior for the HTTPS URI and destination path shown in the report. Done means identifying why the resulting PDF is zero bytes and documenting or verifying a fix with a successful non-empty download.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript, nodejs
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.