I'm downloading a file of exactly 1000K-size (https://gitee.com/WolframPaclet1/WolframPacletExtreme1/raw/master/Paclets/MXNetResources-WIN64-12.0.37.paclet.601) with URLDownload(URLSave, URLRead, Import will produce the same situation). But one or two of the following messages:

URLRead::invhttp: Error while processing content unencoding: invalid code lengths set.
URLRead::invhttp: Error while processing content unencoding: invalid distance too far back.
URLRead::invhttp: Error while processing content unencoding: invalid stored block lengths.
URLRead::invhttp: Error while processing content unencoding: invalid block type.


will be generated.

Perhaps URLDownload is out-date from some protocol?

"HTTP/1.1 200 OK

date: Tue, 31 Mar 2020 05:26:02 GMT

content-type: text/plain

transfer-encoding: chunked

connection: keep-alive

keep-alive: timeout=60

server: nginx

x-xss-protection: 1; mode=block

x-content-type-options: nosniff

x-ua-compatible: chrome=1

expires: Sun, 1 Jan 2000 01:00:00 GMT

pragma: must-revalidate, no-cache, private

content-disposition: inline; filename="MXNetResources-WIN64-12.0.37.paclet.601"

content-transfer-encoding: binary

cache-control: no-cache

set-cookie: oschina_new_user=false; path=/; expires=Sat, 31 Mar 2040 05:26:02 -0000

x-request-id: ee128f06-9ea5-4daa-b9e7-2ec2af51ed7d

x-runtime: 0.107804

content-encoding: gzip"
$$$$

• URLDownload["https://gitee.com/WolframPaclet1/WolframPacletExtreme1/raw/master/Paclets/MXNetResources-WIN64-12.0.37.paclet.601"] works fine for me - what version of Wolfram Language are you using, on what OS? Mar 31 '20 at 8:00
• It works every time for me on MacOS 10.15 and 12.1. I've also tried downloading every file listed on that page (with URLDownload[urls] where urls is a list of the files) However, I do have extremely good internet, so it's still possible it's an internet issue. My guess is that it's related to the gzip encoding though. Perhaps you might have better luck searching for "curl" or "libcurl" and the error messages above. Mar 31 '20 at 9:55
• @CarlLange Thank you very much. I did not know URLDownload uses libcurl before. Mar 31 '20 at 12:12
<<CURLLink