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.

Download it with Chrome will be ok. The file downloaded with URLDownload is about 1020000 bytes. The previous 1020000 bytes is identical with the one downloaded by Chrome.

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

etag: W/"81a7a3370ebada47949a3e644518da29"

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"
  • $\begingroup$ 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? $\endgroup$
    – Carl Lange
    Mar 31 '20 at 8:00
  • $\begingroup$ "12.0.0 for Microsoft Windows (64-bit) (May 18, 2019)". This download may succeed sometimes. During downloading 975 pieces of this, I had received about 10 messages. $\endgroup$
    – bcegkmqs23
    Mar 31 '20 at 8:25
  • $\begingroup$ I've tried this on another environment "12.0.0 for Linux x86 (64-bit) (May 19, 2019)". Strangely I got no message in all 975 attempts. Perhaps it's just due to bad internet? Could you try it repeatedly?@CarlLange $\endgroup$
    – bcegkmqs23
    Mar 31 '20 at 8:28
  • $\begingroup$ 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. $\endgroup$
    – Carl Lange
    Mar 31 '20 at 9:55
  • $\begingroup$ @CarlLange Thank you very much. I did not know URLDownload uses libcurl before. $\endgroup$
    – bcegkmqs23
    Mar 31 '20 at 12:12

This problem can still be reproduced on my Windows. But I've got a solution which is somehow magic.


Evaluate this, and then this problem will disappear for once.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.