fluttercommunity / fluttercommunity/flutter_downloader
Bug Report: Progress Stuck at 0% When Content-Length Is Missing
- Dominant language
- Kotlin
- Stars
- 940
- Forks
- 561
- Avg merge
- 1h 18m
- Merged PRs (30d)
- 1
Description
Describe the bug
When downloading a file using flutter_downloader, if the server does not provide a Content-Length header, the download progress behaves incorrectly:
Progress is stuck at 0% for the entire duration of the download.
After the file is completely downloaded, the progress jumps to 100% instantly.
There is no way to show the actual data size being downloaded in real time.
This leads to poor UX, especially for larger files, where the user sees no visual indication that the file is actively downloading.
To Reproduce
Steps to reproduce the behavior:
Use flutter_downloader to download a file from a source that doesn’t send a Content-Length header (e.g., https://cobalt.tools/)
Observe the progress value in the port listener
Progress stays at 0% until the download finishes
Progress suddenly jumps to 100%
Expected behavior
Even if Content-Length is missing, it should be possible to:
Show the actual amount of data received so far (e.g., in MB)
Provide consistent progress feedback to the user (e.g., "Downloading... 4.3 MB")
Avoid misleading behavior (i.e., stuck at 0%)
Screenshots
N/A – but the issue can be observed using logs or a progress bar in the app.
OS: Android/iOS
Device information:
Device: [ iPhone 15 Pro]
OS: [ iOS 17.5]
Plugin version: [e.g. flutter_downloader v1.11.8]
Additional context
We understand that when Content-Length is unavailable, calculating percentage progress is not possible.
However, users still need some indication that the file is being downloaded. It would be helpful if:
- The plugin exposed the current downloaded file size periodically (even without total size)
- Developers could hook into this to show estimated progress or at least show "x MB downloaded"
This would improve user trust and usability for file downloads from servers that don’t send size headers.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the download with flutter_downloader using a source such as https://cobalt.tools/ that omits Content-Length, then observe the progress value in the port listener. Review the plugin's download progress API and platform behavior to determine how downloaded bytes can be exposed without a total size. Done means users receive ongoing download-size or progress feedback instead of 0% until an instant jump to 100%.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100