apache / apache/cordova-plugin-file-transfer

Failed to download the 1.07G file

Open
#388 3 comments 0 reactions 0 assignees View on GitHub
Info Needed
Dominant language
JavaScript
Stars
606
Forks
874
PR merge metrics
No merged PRs in 30d

Description

# Bug Report

## Problem
I download a file larger than 1G (1.07G).

### What is expected to happen?
Download file success.

### What does actually happen?
Download failed and throw an Exception.
Android Logcat:
12-11 16:23:15.354 8552 8760 E FileTransfer: java.net.ProtocolException: unexpected end of stream
12-11 16:23:15.354 8552 8760 E FileTransfer: at com.android.okhttp.internal.http.Http1xStream$FixedLengthSource.read(Http1xStream.java:398)
12-11 16:23:15.354 8552 8760 E FileTransfer: at com.android.okhttp.okio.RealBufferedSource$1.read(RealBufferedSource.java:372)
12-11 16:23:15.354 8552 8760 E FileTransfer: at java.io.FilterInputStream.read(FilterInputStream.java:133)
12-11 16:23:15.354 8552 8760 E FileTransfer: at org.apache.cordova.filetransfer.FileTransfer$SimpleTrackingInputStream.read(FileTransfer.java:157)
12-11 16:23:15.354 8552 8760 E FileTransfer: at java.io.FilterInputStream.read(FilterInputStream.java:107)
12-11 16:23:15.354 8552 8760 E FileTransfer: at org.apache.cordova.filetransfer.FileTransfer$2.run(FileTransfer.java:812)
12-11 16:23:15.354 8552 8760 E FileTransfer: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
12-11 16:23:15.354 8552 8760 E FileTransfer: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
12-11 16:23:15.354 8552 8760 E FileTransfer: at java.lang.Thread.run(Thread.java:923)

## Information

If file size smaller than 1G, It will download success.

### Command or Code

None

### Environment, Platform, Device And Version information

device: rk3568
file-transer plugin version: 1.7.1
os: Android 11
webview version: 134.0.6998.4
cordova version: 10.0.0
angular version: 10.0.14

## Checklist

- [x] I searched for existing GitHub issues
- [ ] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

The Android path is shown in FileTransfer.java at lines 157 and 812; start by reading the tracking stream and download task around those stack frames, then reproduce with a file over 1G on Android 11. Done means the 1.07G download completes without the unexpected end-of-stream exception, while smaller-file behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.