fluttercommunity / fluttercommunity/flutter_downloader
Gzip file not automatically uncompressed on iOS
- Dominant language
- Kotlin
- Stars
- 940
- Forks
- 561
- Avg merge
- 1h 18m
- Merged PRs (30d)
- 1
Description
When downloading a gzip file with a response containing `Content-Encoding=gzip`, the file is uncompressed automatically on Android.
However, that does not seem to be the case on iOS.
On iOS, when trying to read the file as String I was receiving the following error: `Failed to decode data using encoding 'utf-8'`.
After manually using `GZipCodec.deocode()` on the file bytes I was able to read it.
**To Reproduce**
Steps to reproduce the behavior:
1. Enqueue download task for a gzip file on Android and iOS
2. Attempt to read using `File().readAsString` after file finishes with DownloadStatusResult.complete
3. Observe file contents on Android, and `Failed to decode data using encoding 'utf-8'` on iOS.
**Expected behavior**
autoUncompress to apply to downloaded gzip files across platforms.
https://api.flutter.dev/flutter/dart-io/HttpClient/autoUncompress.html
**Device information:**
- Device: iPhone 11 Pro
- OS: iOS 16.0.2 20A380
- Device: Galaxy S20 FE 5G
- OS: Android 13 (API 33)
- plugin version 1.10.2
**Additional context**
Flutter version 3.3.9
Dart version 2.18.5
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.