flutter_downloader
flutter_downloader copied to clipboard
Gzip file not automatically uncompressed on iOS
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:
- Enqueue download task for a gzip file on Android and iOS
- Attempt to read using
File().readAsStringafter file finishes with DownloadStatusResult.complete - 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