End of Central Directory record could not be found

后端 未结 10 1871
温柔的废话
温柔的废话 2020-11-29 10:39

I am downloading a zip file using c# program and I get the error

at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
   at System.IO.Compression         


        
10条回答
  •  甜味超标
    2020-11-29 11:35

    I just came across this thread when I had the same error from a PowerShell script calling the Net.WebClient DownloadFile method.

    In my case, the problem was that the web server was unable to provide the requested zip file, and instead provided an HTML page with an error message in it, which obviously could not be unzipped.

    So instead, I created an exception handler to extract and present the "real" error message.

提交回复
热议问题