flutter_downloader icon indicating copy to clipboard operation
flutter_downloader copied to clipboard

Gzip file not automatically uncompressed on iOS

Open lielvan opened this issue 2 years ago • 0 comments

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

lielvan avatar Mar 12 '23 15:03 lielvan