Central Directory Entry not found (ZipException)

前端 未结 1 918
面向向阳花
面向向阳花 2021-01-22 17:17

I am trying download zip file to SD card. I download it correctly, but when I open downloaded file (with ZipFile) I get this ZipException (\"Central Directory Entry not found\")

相关标签:
1条回答
  • 2021-01-22 17:38

    Auto-answer: The problem was that HTTP request use Accept-Encoding: gzip.

    The server returned an already compressed file and download it, decompress it, removing part of the header.

    Unfortunately, 7zip opened correctly (probably, not check headers), but Android not open file (probably, check headers).

    In short: Be careful, and check correctly file-encoding with some files.

    0 讨论(0)
提交回复
热议问题