[
  {
    "Id": "266087",
    "ThreadId": "77806",
    "Html": "<p>Hi</p>\r\n<p>We have been getting this exception suddenly today.</p>\r\n<p>We have 2 applications where app1 (uses Vs2005) which is the admin app generates the zip files.</p>\r\n<p>Then the app2 (uses Vs2008) which is the client app reads these files.</p>\r\n<p>It was working fine till today morning and nothing has changed in the generation of zip file method but suddenly we have been getting this exception:</p>\r\n<p>at Ionic.Zip.ZipEntry.ReadHeader(ZipEntry ze, Encoding defaultEncoding)<br>&nbsp;&nbsp; at Ionic.Zip.ZipEntry.ReadEntry(ZipContainer zc, Boolean first)<br>&nbsp;&nbsp; at Ionic.Zip.ZipFile.ReadIntoInstance_Orig(ZipFile zf)<br>&nbsp;&nbsp; at Ionic.Zip.ZipFile.ReadIntoInstance(ZipFile zf)<br>&nbsp;&nbsp; at Ionic.Zip.ZipFile.Read(String fileName, TextWriter statusMessageWriter, Encoding encoding, EventHandler`1 readProgress)<br>&nbsp;&nbsp; at Ionic.Zip.ZipFile.Read(String fileName, TextWriter statusMessageWriter, Encoding encoding)<br>&nbsp;&nbsp; at Ionic.Zip.ZipFile.Read(String fileName)</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>One other thing I have done is created a test console application using VS2005 and loaded the zip file successfully using:</p>\r\n<p>ZipFile.Read method.</p>\r\n<p>Please let us know if you have any suggestions</p>\r\n<p>Thanks</p>\r\n<p>N</p>",
    "PostedDate": "2009-12-10T22:38:11.747-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "266351",
    "ThreadId": "77806",
    "Html": "<p>I suspect something is wrong in the zip file. It has been corrupted, or it is not the same file you wrote. It's not the file you think it is. &nbsp;</p>\r\n<p>DotNetZip will not follow the code path in your message, unless the zip file is corrupted.</p>\r\n<p>The clue is ReadIntoInstance_Orig().&nbsp; It is a fallback approach. Normally DotNetZip scans to the end of a file, and works backward, looking for the central directory.&nbsp; It goes back a maximum of 0x4000 bytes, (16384) which is more than enough for a normal zip file, and much more than enough for a zip file generated by DotNetZip itself.&nbsp; Only if it fails to find the end of directory signature in the final 16384 bytes of the file, will DotNetZip resort to trying ReadIntoInstance_Orig .&nbsp;</p>\r\n<p>(The exception to this is if the input stream is non-seekable, because the normal approach requires seeking through the file.&nbsp; But your filestream should be seekable) .</p>\r\n<p>So... check your assumptions.&nbsp; The file you're trying to read appears to NOT be a zip file.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-12-11T10:32:35.063-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]