title: End of Central Directory record could not be found
body: <p>I am downloading a zip file using c# program and I get the error </p>
  
  <pre><code>at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
     at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode,
  Boolean leaveOpen)
     at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode,
   Boolean leaveOpen, Encoding entryNameEncoding)
     at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode
  mode, Encoding entryNameEncoding)
     at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileN
  ame, String destinationDirectoryName, Encoding entryNameEncoding)
     at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileN
  ame, String destinationDirectoryName)
  </code></pre>
  
  <p>Here's the program</p>
  
  <pre><code>    response = (HttpWebResponse)request.GetResponse();
      Stream ReceiveStream = response.GetResponseStream();
      byte[] buffer = new byte[1024];
      FileStream outFile = new FileStream(zipFilePath, FileMode.Create);
      int bytesRead;
      while ((bytesRead = ReceiveStream.Read(buffer, 0, buffer.Length)) != 0)
          outFile.Write(buffer, 0, bytesRead);
      outFile.Close();
      response.Close();
      try
      {
          ZipFile.ExtractToDirectory(zipFilePath, destnDirectoryName);
      }
      catch (Exception e)
      {
          Console.WriteLine(e.ToString());
          Console.ReadLine();
      }
  </code></pre>
  
  <p>I do not understand the error. Can anybody explain this
  Thanks
  MR</p>