[
  {
    "Id": "214733",
    "ThreadId": "63188",
    "Html": "<p>I have some large zip files which contain files that are over 4GB, in the current case 16GB, when extracted. I can extract the files no problem using Winzip 8.1 and WinRar 3.60, but when I try using DotNetZip I am getting the follwoing error once 4GB has been extracted:</p>\r\n<p>CRC error: the file being extracted appears to be corrupted. Expected 0x33384163, Actual 0x7C445495</p>\r\n<p>I am using a Script Task in SSIS and the code used is as follows:</p>\r\n<p>&nbsp;&nbsp; &nbsp;Private Sub Decompress()</p>\r\n<div id=\"_mcePaste\" style=\"left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden\">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Using m_ZIP As ZipFile = ZipFile.Read(Me.ZIPFileName)</div>\r\n<div id=\"_mcePaste\" style=\"left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden\">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Dim m_ZipEntry As ZipEntry</div>\r\n<div id=\"_mcePaste\" style=\"left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden\">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For Each m_ZipEntry In m_ZIP</div>\r\n<div id=\"_mcePaste\" style=\"left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden\">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Try</div>\r\n<div id=\"_mcePaste\" style=\"left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden\">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;m_ZipEntry.Extract(Path.GetDirectoryName(Me.ZIPFileName), ExtractExistingFileAction.OverwriteSilently) 'True)</div>\r\n<div id=\"_mcePaste\" style=\"left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden\">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Catch ex As Exception</div>\r\n<div id=\"_mcePaste\" style=\"left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden\">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox.Show(ex.Message)</div>\r\n<div id=\"_mcePaste\" style=\"left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden\">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End Try</div>\r\n<div id=\"_mcePaste\" style=\"left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden\">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Next</div>\r\n<div id=\"_mcePaste\" style=\"left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden\">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;End Using</div>\r\n<div id=\"_mcePaste\" style=\"left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden\">&nbsp;&nbsp; &nbsp;End Sub</div>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Using m_ZIP As ZipFile = ZipFile.Read(Me.ZIPFileName)</p>\r\n<p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Dim m_ZipEntry As ZipEntry</p>\r\n<p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;For Each m_ZipEntry In m_ZIP</p>\r\n<p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Try</p>\r\n<p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;m_ZipEntry.Extract(Path.GetDirectoryName(Me.ZIPFileName), ExtractExistingFileAction.OverwriteSilently)&nbsp;</p>\r\n<p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Catch ex As Exception</p>\r\n<p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox.Show(ex.Message)</p>\r\n<p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End Try</p>\r\n<p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Next</p>\r\n<p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;End Using</p>\r\n<p>&nbsp;&nbsp; &nbsp;End Sub</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>Could you let me know if there is something I am doing wrong or if it is possible to perform this extraction? The zip file is supplied by a 3rd party and having had other dealing with them I doubt I will be able to get information from them as to how it was created.</p>\r\n<p>Thanks in advance</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-22T05:27:50.117-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "214771",
    "ThreadId": "63188",
    "Html": "<p>Your code looks fine.</p>\r\n<p>What version of DotNetZip are you using?&nbsp; Earlier versions had some problems with very large ZIP files.</p>\r\n<p>How do you know the problem happens with 4gb extracted - how can you tell?</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-22T07:20:28.123-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "214988",
    "ThreadId": "63188",
    "Html": "<p>Thanks for the confirmation of the code.</p>\r\n<p>The version I am using is the latest version downloaded from here last week, 1.8 (not sure of the exact release as it is on my work pc and I am currently at home).</p>\r\n<p>I can see it arrives to 4GB (or thereabouts) as I have the folder being extracted to visible, and updating, during the extraction.</p>",
    "PostedDate": "2009-07-22T14:57:49.033-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "215022",
    "ThreadId": "63188",
    "Html": "<p>Hmmmm, ok.&nbsp; I will run some tests.&nbsp;</p>",
    "PostedDate": "2009-07-22T16:05:37.317-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "215119",
    "ThreadId": "63188",
    "Html": "\r\n\r\n<div class=Section1>\r\n\r\n<p class=MsoNormal>Cheeso</p>\r\n\r\n<p class=MsoNormal> </p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>Just to confirm the version I am using is 1.8.4.5.</span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>Also the attached screenshot might help\r\nyou. As you can see the file (Datoscsmo_ufd_20090627.txt) in the zip file shows\r\nas being 4GB, but when extracted it is 16GB. Might this be part of the problem?</span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>Regards </span><span lang=EN-GB></span></p>\r\n\r\n</div>\r\n\r\n",
    "PostedDate": "2009-07-22T23:40:35.557-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "215219",
    "ThreadId": "63188",
    "Html": "<p>Yes - the size mismatch you mentioned could be part of the problem.</p>\r\n<p>Where's the screen shot?&nbsp; is the screen shot produced by DotNetZip?&nbsp; Or WinZip?</p>\r\n<p>Is the zipfile produced by DotNetZip, or some other tool?</p>\r\n<p>Can you restate the problem for me.&nbsp; Originally the problem was, DotNetZip was throwing when you were extracting, and when the app had extracted more than 4gb on a single file.&nbsp; Is that still the problem?</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-23T04:01:13.6-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "215227",
    "ThreadId": "63188",
    "Html": "<p><img alt=\"\"><img alt=\"\"><img alt=\"\"></p>\r\n<p>I attached a screen shot in my previous e-mail reply. I don't seem to be able to paste into here so if you can't get it from the previous message let me know how I can get it to you if it is necessary. It was taken from Winzip, although I get the same results from WinRar and stepping through the code DotNetZip only recognizes the file size as 4,048,964 kb in size compared to the 16,536,980 KB of the unzipped file in Windows Explorer.</p>\r\n<p>I have no idea as to how the zip file is produced as it is supplied by a 3rd party and, as mentioned before, they have been singularly unhelpful in helping us out with this data previously. Saying that I would be pretty certain that the file is created with an application such as WinZip.</p>\r\n<p>The original problem is that DotNetZip throws the error &quot;CRC error: the file being extracted appears to be corrupted. Expected 0x33384163, Actual 0x7C445495&quot; on extraction upon reaching 4GB. At present I only have one file of this size and if I catch the error and move on to the next file within the zip file that extracts okay.</p>\r\n<p>Thanks.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p><img alt=\"\"></p>",
    "PostedDate": "2009-07-23T04:18:23.1-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "215237",
    "ThreadId": "63188",
    "Html": "<p>ok, clear.&nbsp; There's a gateway that posts the email that you send, to the forums.&nbsp; When I respond to you I am using the forums on codeplex.com, not sending/receiving email.&nbsp;&nbsp; In the forums UI, it is just HTML and you can embed a picture.&nbsp; It needs to be available somewhere.&nbsp; I often use tinypic.com for the purpose.&nbsp; The steps are:&nbsp; take screenshot, save screenshot, upload to tinypic, get URL, edit HTML on codeplex forum, paste URL to picture.</p>\r\n<p>Are you saying that WinRar and WinZip can successfully extract the file? in the screenshot is it clear whether the 4gb size is referring to uncompressed or compressed size?&nbsp; Which is it?</p>\r\n<p>When reading or extracting a zip archive, DotNetZip first looks in the zipfile for the metadata for the entry.&nbsp; This metadata includes the uncompressed size, the compressed size, the filename, the compression method, the CRC, a comment, and other stuff. &nbsp; If the app then calls ZipEntry.Extract(), dotnetzip will decompress the bytes in the zip file, until reaching the &quot;compressed size&quot; number of bytes.&nbsp; It then compares the CRC in the metadata with the resulting CRC of the uncompressed data.</p>\r\n<p>Normally this all works nicely.&nbsp; But what appears to be happening in your case is the CRC check is failing.&nbsp; This can happen if</p>\r\n<ol type=a>\r\n<li>The CRC stored in the metadata is invalid</li>\r\n<li>the compressed size stored in the metadata is invalid</li>\r\n</ol>\r\n<p>If the problem is that there is not enough compressed data in the file, you should get a different error - a length check should fail.&nbsp; Supposing the original compressed size was 4.8gb, and the zip file had only 4.2gb, the decompress will throw when it runs out of data.&nbsp; If there is a problem with corruption of the compressed data in the zip file, you will get yet another different error, a ZLIB protocol error.&nbsp;</p>\r\n<p>Not all unzip tools verify the CRC of an entry on extract, but I believe WinZip does.</p>\r\n<p>It sounds to me that you may have the latter case - the compressed size may not be valid.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-23T04:37:18.233-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "215245",
    "ThreadId": "63188",
    "Html": "\r\n\r\n<div class=Section1>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>Thanks for your quick reply. I will keep\r\nnotes of how to attach an image for future reference</span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>As you say it seems to be the metadata compressed\r\nsize, or CRC, that is causing the problem. We download a file from the 3rd\r\nparty on a monthly basis and looking at the old files the compressed size\r\nstored in the metadata never equals the size of the extracted file, so something\r\nin the way that the zip file is produced is not working correctly but although\r\nI will get in touch regarding the problem it is causing us I don’t expect\r\na reply from them. </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>It looks like for this file only (your\r\nlibrary works really well for all other zip files we receive) I’ll have\r\nto look at an alternative method of extraction (probably by directly calling\r\nWinzip from my app)</span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span style=\"font-size:10.0pt;font-family:'Arial','sans-serif'\">Kind\r\nregards</span><span lang=EN-GB style=\"font-size:10.0pt;font-family:'Arial','sans-serif'\"></span></p>\r\n\r\n<p class=MsoNormal> </p>\r\n\r\n</div>\r\n\r\n",
    "PostedDate": "2009-07-23T04:51:34.013-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "215259",
    "ThreadId": "63188",
    "Html": "<p>??</p>\r\n<p>Just one thing - you said the <em>&quot;compressed size stored in the metadata never equals the size of the extracted file</em>&quot; .&nbsp; In a zip, the <em><strong>uncompressed size </strong></em>stored in the metadata should equal the size of the extracted file.</p>\r\n<p>As for alternative methods of extraction, if you use DotNetZip and open a read stream on the entry, the CRC check is not done by the library.&nbsp; The app is expected to do that itself.&nbsp; Check out <a href=\"http://cheeso.members.winisp.net/DotNetZipHelp/html/ea82f312-372e-edad-d374-8db2486e70ba.htm\">the doc for ZipEntry.OpenReader()</a>.&nbsp;&nbsp; That might work for you if the only problem is a CRC check.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-23T05:29:14.67-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "215673",
    "ThreadId": "63188",
    "Html": "\r\n\r\n<div class=Section1>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>Sorry I got my Uncompressed and Compressed\r\nmixed up. The compressed size does show correctly, the uncompressed doesn’t\r\n(this depends a bit on how you class correctly, as it does show the same\r\nuncompressed size as displayed when the zip file is opened in Winzip/Winrar,\r\nbut this is not the actual size of the final extracted file). Either way it\r\nlooks as though it is more a problem with the actual file than your library. </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>I will try the OpenReader method if I get a\r\nchance.</span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>Thanks for all you help.</span><span lang=EN-GB style=\"font-size:10.0pt;font-family:'Arial','sans-serif'\"></span></p>\r\n\r\n<p class=MsoNormal> </p>\r\n\r\n</div>\r\n\r\n",
    "PostedDate": "2009-07-24T03:44:40.31-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "215682",
    "ThreadId": "63188",
    "Html": "<p>if winzip, winrar and DotNetZip all agree on the uncompressed size of an entry, and that size does not match the size of the actual file used to produce the entry, then it seems like there was an error during the creation of that&nbsp;zip file.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-07-24T04:14:11.947-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225337",
    "ThreadId": "63188",
    "Html": "<p>Cheeso</p>\r\n<p>I have tried using the OpenReader method and have pasted my code below, but I am still unable to fully extract the large files from the zip file. Further below I have added a screen shot which shows the zip file and the extracted file.</p>\r\n<p>The file that is causing me problems is <strong>Datoscsmo_ufd_20090801.txt</strong>. As you can see the uncompressed size of the file within the zp file is 1,142,685,138 bytes, which is the final value of totalBytesRead when the code is completed. However extracting the file using Winzip leaves me with a file of over 13GB (14,027,587,026 bytes according to the file properties).</p>\r\n<p>This may be something I am unable to resolve using the DotNetZip library, but I would welcome any comments you may have.</p>\r\n<p>Thanks</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre>        <span style=\"color:Blue\">Using</span> zip <span style=\"color:Blue\">As</span> <span style=\"color:Blue\">New</span> ZipFile(<span style=\"color:Blue\">Me</span>.ZIPFileName)\r\n            <span style=\"color:Blue\">Dim</span> e1 <span style=\"color:Blue\">As</span> ZipEntry\r\n            <span style=\"color:Blue\">For</span> <span style=\"color:Blue\">Each</span> e1 <span style=\"color:Blue\">In</span> zip\r\n                sNombreFichero = Path.Combine(Path.GetDirectoryName(<span style=\"color:Blue\">Me</span>.ZIPFileName), Path.GetFileName(e1.FileName))\r\n                <span style=\"color:Blue\">Using</span> swWrite <span style=\"color:Blue\">As</span> Stream = File.Create(sNombreFichero)\r\n                    <span style=\"color:Blue\">Using</span> s <span style=\"color:Blue\">As</span> Ionic.Zlib.CrcCalculatorStream = e1.OpenReader\r\n                        <span style=\"color:Blue\">Dim</span> n <span style=\"color:Blue\">As</span> <span style=\"color:Blue\">Integer</span>\r\n                        <span style=\"color:Blue\">Dim</span> buffer <span style=\"color:Blue\">As</span> <span style=\"color:Blue\">Byte</span>() = <span style=\"color:Blue\">New</span> <span style=\"color:Blue\">Byte</span>(4096) {}\r\n                        <span style=\"color:Blue\">Dim</span> totalBytesRead <span style=\"color:Blue\">As</span> <span style=\"color:Blue\">Integer</span> = 0\r\n                        <span style=\"color:Blue\">Do</span>\r\n                            n = s.Read(buffer, 0, buffer.Length)\r\n                            swWrite.Write(buffer, 0, buffer.Length)\r\n                            totalBytesRead = (totalBytesRead + n)\r\n                        <span style=\"color:Blue\">Loop</span> <span style=\"color:Blue\">While</span> (n &gt; 0)\r\n                    <span style=\"color:Blue\">End</span> <span style=\"color:Blue\">Using</span>\r\n                <span style=\"color:Blue\">End</span> <span style=\"color:Blue\">Using</span>\r\n            <span style=\"color:Blue\">Next</span>\r\n        <span style=\"color:Blue\">End</span> <span style=\"color:Blue\">Using</span>\r\n<br><br></pre>\r\n</div>\r\n<p><a href=\"http://tinypic.com\"><img src=\"http://i27.tinypic.com/23ly2bo.jpg\" alt=\"\"></a></p>\r\n<p><a href=\"http://tinypic.com\"><br></a></p>",
    "PostedDate": "2009-08-19T02:24:08.933-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225368",
    "ThreadId": "63188",
    "Html": "<p>use</p>\r\n<p>Dim totalBytesRead as Long</p>\r\n<p>i.e.&nbsp;use a 64 bits integer</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-08-19T04:36:46.467-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225393",
    "ThreadId": "63188",
    "Html": "<p>Gilles</p>\r\n<p>Good spot that, but at the moment that is not causing the error. Even using a Dim totalBytesRead as Long, the final extracted file size with DotNetZip is 1,142,685,138 bytes compared to over 13GB when extracted using Winzip or Winrar. Then problem seems to be that DotNetZip is only expecting that amount of data to be extracted and stops at that point, despite the fact there must be more data within the zip file.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-08-19T05:51:38.597-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225419",
    "ThreadId": "63188",
    "Html": "<p style=\"padding-left:30px\">When the file is uncompressed (with the inflate algorithm), the end of the file can be detected from the data itself (when Read returns 0 bytes). If the library stops when having reading uncompressedsize bytes, the CRC is probably wrong, if there is actually more data.</p>\r\n<p style=\"padding-left:30px\">It let me think that .zip files can conversely&nbsp;contain holes with data not described by entries; it is not pleasant from a security point of view. But this is how self extracting archives work, as I understand.</p>",
    "PostedDate": "2009-08-19T06:53:27.34-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225467",
    "ThreadId": "63188",
    "Html": "<p>Lew, when you do</p>\r\n<pre>  swWrite.Write(buffer, 0, buffer.Length)\r\n</pre>\r\n<p>you probably want, instead,</p>\r\n<pre>  swWrite.Write(buffer, 0, n)\r\n</pre>\r\n<p>This is because the preceding stream read can be partially filled, and only the first n bytes are valid.</p>\r\n<p>Secondly, what WinZip is showing and doing seems confusing to me. It reports an uncompressed size of 1gb, but then when you unpack, it generates a file of size 13gb. IS that right? Am I understanding correctly? If so, that indicates a problem in WinZip, to me.</p>\r\n<p>What does DotNetZip tell you the uncompressed size is? You seem to be telling me that when extracting with DotNetZip, you get a file of size X, where X is the UncompressedSize of the ZipEntry. This seems to be correct behavior on the part of DotNetZip, unless I am misunderstanding something.</p>\r\n<p>The surprise is that WinZip's reported UncompressedSize does not match the actual Uncompressed size of a file, when extracted by WinZip. This seems to be a problem in WinZip, if I am understanding the situation correctly.</p>\r\n<p>Gilles: yes, the zip file can contain arbitrary data, and there is no requirement that the data for each zip entry immediately follows the prevvious. It is not only self-extracting archives that work this way. And yes, this is a way that viruses have been delivered. Scanning engines must check zip files for malicious payloads, because of this.</p>",
    "PostedDate": "2009-08-19T08:26:12.727-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225743",
    "ThreadId": "63188",
    "Html": "<p>Cheeso</p>\r\n<p>Thanks for you reply, but I still get the same result with DotNetZip whereby the size of the extracted file is equal to the UncompressedSize of the ZipEntry.</p>\r\n<p>With both Winzip and Winrar when viewing the zip file within the respective application shows that the zipped file has a size of 1GB, yet both applications extract a file of size 13GB.</p>\r\n<p>Basically your understanding of my situation is correct. Unfortunately, as mentioned before the file in question is one we receive on a monthly basis from a 3rd party who have, up to now, been wholly uncooperative when we have requested help. I have been able to find a work around using something other than DotNetZip but for consistency was hoping to use DotNetZip for these files as well.</p>\r\n<p>Thanks for your help</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-08-20T00:11:56.7-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "225897",
    "ThreadId": "63188",
    "Html": "<p>Lewshouse, I don't understand the situation I think.&nbsp;</p>\r\n<p>You're telling me that DotNetZip is creating a file with THE EXPECTED SIZE.&nbsp; The UncompressedSize IS the expected size of the file after de-compression.&nbsp; And DotNetZip is producing a file of that size.&nbsp; And you're telling me, you don't want that.&nbsp; This is what I don't understand.&nbsp;</p>\r\n<p>It seems to be correct behavior on the part of DotNetZip.&nbsp; I'm not trying to be difficult here. I understand that WinZip and WinRar both produce a file with 13gb size, but it does not seem to be correct behavior.&nbsp; Even WinZip shows the UncompressedSize as 1.1gb, so why should it produce a file of size 13gb?&nbsp;&nbsp;</p>\r\n<p>If I have a file that is 1000 bytes normally, and I zip it up into 400 bytes, then I get an entry that has UncompressedSize = 1000, and&nbsp;CompressedSize = 400.&nbsp; When I extract that file I expect it to be 1000 bytes in the filesystem.&nbsp; This is what is happening with you, though the numbers are higher.&nbsp; DotNetZip is producing a file upon extraction that has a size equal to the UncompressedSize.&nbsp; This seems like correct behavior.</p>\r\n<p>I don't know where the 13gb is coming from.&nbsp;</p>\r\n<p>If you're telling me that the original file is or was 13gb, and when zipped, the zipfile says the UncompressedSize was around 1.1gb (as I think you mentioned), then it seems like the zip file is broken.&nbsp; And if the zipfile is broken, there needs to be a change by whoever is producing it. &nbsp;And yes, I understand they're not responsive, but ... (shrug).&nbsp;</p>\r\n<p>I also understand that its frustrating that WinZip produces a 13gb file.&nbsp; But like I said, it seems to be broken behavior. Something isn't right.</p>\r\n<p>Sometimes a zipfile can be internally inconsistent.&nbsp; There are two places to store the metadata for each entry - the name, the uncompressed and compressed sizes, and so on.&nbsp; One is called the &quot;entry header&quot;, and the other is called the &quot;Central directory&quot;.&nbsp; &nbsp;In some cases the entry header and the central directory get out of sync.&nbsp; There is a CheckZip method on the ZipFile class that can correct these problems, in some cases.&nbsp; You might try running your zipfile through that method.&nbsp; It may help.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-08-20T08:06:15.5-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "226186",
    "ThreadId": "63188",
    "Html": "\r\n\r\n<div class=Section1>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>Cheeso</span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>Thanks for your replies and attempts to\r\nhelp in this matter. Unfortunately although DotNetZip functions correctly and\r\nextracts a file of the size expected from the UncompressedSize property I need\r\nto extract the whole, in this case, 13GB, and need to be able to do it programmatically\r\nwithout recourse to directly calling an application such as WinZip.</span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>Since I have started this job I have\r\nreceived four versions of the zip file from the 3rd party and in\r\neach case the file extracted by WinZip/WinRar is significantly larger than the uncompressed\r\nsize they show, so something is obviously occurring during the creation of the\r\nzip file, but as I cannot get any response from the supplier (a large Spanish\r\nelectricity supplier) am unable to find out what this is. </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB>For now I will have to look at alternatives\r\nwhich is a shame as if I change from DotNetZip for this supplier I will have to\r\ndo so for the other 4 we use and therefore re-write code that functions\r\nperfectly.</span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB> </span></p>\r\n\r\n</div>\r\n\r\n",
    "PostedDate": "2009-08-21T00:24:06.613-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "226199",
    "ThreadId": "63188",
    "Html": "<p>Cheeso,</p>\r\n<p>would it make sense to read the deflated stream until its end (read returning 0)&nbsp;, not taking into account the stored uncompressed size?</p>\r\n<p>It seems other utilities are doing that way, and it would not modify the behavior for correct files.</p>",
    "PostedDate": "2009-08-21T01:13:14.457-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "226207",
    "ThreadId": "63188",
    "Html": "<p>GM - cannot really do that. The problem is, if I keep reading past the &quot;uncompressed size&quot; I am reading metadata in the zipfile for the next entry.&nbsp; It will break.</p>\r\n<p>LH - what about trying the CheckZip method?&nbsp; Have you considered that?&nbsp; It's a simple API call.&nbsp; Worth a try.&nbsp;</p>",
    "PostedDate": "2009-08-21T01:44:05.55-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "226225",
    "ThreadId": "63188",
    "Html": "\r\n\r\n<div class=Section1>\r\n\r\n<p class=MsoNormal><span style=\"font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D\">Cheeso </span></p>\r\n\r\n<p class=MsoNormal><span style=\"font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D\"> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB style=\"font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D\">I’ve tried the CheckZip method but that returns true.</span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB style=\"font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D\"> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB style=\"font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D\">Thanks</span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB style=\"font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D\"> </span></p>\r\n\r\n<p class=MsoNormal><span lang=EN-GB style=\"font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D\">Lewshouse</span></p>\r\n\r\n</div>\r\n\r\n",
    "PostedDate": "2009-08-21T02:23:56.757-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "226380",
    "ThreadId": "63188",
    "Html": "<p>well then I'm at a loss for how to help.</p>\r\n<p>you can't get me the zip file because of privacy concerns.</p>\r\n<p>By your description, DotNetZip appears to be working correctly, although I understand it is not working the same as WinZip or WinRar.</p>\r\n<p>I don't know how to fix this?</p>\r\n<p>Good luck.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2009-08-21T08:52:20.513-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "226944",
    "ThreadId": "63188",
    "Html": "<p>Perhaps the compressedsize is smaller than the actual deflated data in entry, and Winzip continues inflating after compressedsize bytes have been read, until the inflate algorithm returns 0 bytes.</p>",
    "PostedDate": "2009-08-24T01:12:05.753-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "227048",
    "ThreadId": "63188",
    "Html": "<p>if you can recompile the code from Cheeso, try the following change&nbsp;for OpenReader to see if the problem is acyually here:</p>\r\n<p><span style=\"font-size:x-small\">&lt;font size=&quot;2&quot;&gt;\r\n<p>&nbsp;</p>\r\n&lt;/font&gt;</span>\r\n<p><span style=\"color:#0000ff;font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\">private</span></span><span style=\"font-size:x-small\"> Ionic.Zlib.CrcCalculatorStream InternalOpenReader(</span><span style=\"color:#0000ff;font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\">string</span></span><span style=\"font-size:x-small\"> password)</span></p>\r\n</p>\r\n<p>&nbsp;{</p>\r\n<p><span style=\"color:#808080;font-size:x-small\"><span style=\"color:#808080;font-size:x-small\">///</span></span><span style=\"color:#008000;font-size:x-small\"><span style=\"color:#008000;font-size:x-small\">...</span></span><span style=\"font-size:x-small\"> </span></p>\r\n<p><span style=\"color:#008000;font-size:x-small\"><span style=\"color:#008000;font-size:x-small\">// change</span></span><span style=\"font-size:x-small\">\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</span></p>\r\n<p><span style=\"color:#0000ff;font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\">&lt;font size=&quot;2&quot; color=&quot;#0000ff&quot;&gt;&lt;font size=&quot;2&quot; color=&quot;#0000ff&quot;&gt;\r\n<p>return&nbsp;</p>\r\n&lt;/font&gt;&lt;/font&gt;</span>&lt;font size=&quot;2&quot; color=&quot;#0000ff&quot;&gt;\r\n<p>&nbsp;</p>\r\n&lt;/font&gt;</span>\r\n<p><span style=\"font-size:x-small\"> </span><span style=\"color:#0000ff;font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\">new</span></span><span style=\"font-size:x-small\"> Ionic.Zlib.CrcCalculatorStream((CompressionMethod == 0x08) ? </span><span style=\"color:#0000ff;font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\">new</span></span><span style=\"font-size:x-small\"> Ionic.Zlib.DeflateStream(input2, Ionic.Zlib.CompressionMode.Decompress, </span><span style=\"color:#0000ff;font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\">true</span></span><span style=\"font-size:x-small\">): input2, _UncompressedSize);</span></p>\r\n<p><span style=\"font-size:x-small\">// into</span></p>\r\n</p>\r\n<p>\r\n<p><span style=\"font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\">&lt;font size=&quot;2&quot; color=&quot;#0000ff&quot;&gt;&lt;font size=&quot;2&quot; color=&quot;#0000ff&quot;&gt;\r\n<p>return</p>\r\n&lt;/font&gt;&lt;/font&gt;</span>&lt;font size=&quot;2&quot; color=&quot;#0000ff&quot;&gt;\r\n<p>&nbsp;</p>\r\n&lt;/font&gt;</span>\r\n<p><span style=\"font-size:x-small\"> (CompressionMethod == 0x08)? </span><span style=\"color:#0000ff;font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\">new</span></span><span style=\"font-size:x-small\"> Ionic.Zlib.CrcCalculatorStream(</span><span style=\"color:#0000ff;font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\">new</span></span><span style=\"font-size:x-small\"> Ionic.Zlib.DeflateStream(input2, Ionic.Zlib.CompressionMode.Decompress, </span><span style=\"color:#0000ff;font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\">true</span></span><span style=\"font-size:x-small\">)): </span><span style=\"color:#0000ff;font-size:x-small\"><span style=\"color:#0000ff;font-size:x-small\">new</span></span><span style=\"font-size:x-small\"> Ionic.Zlib.CrcCalculatorStream(input2,_UncompressedSize);</span></p>\r\n&lt;font size=&quot;2&quot;&gt;\r\n<p>&nbsp;</p>\r\n&lt;/font&gt;</span>\r\n<p>&nbsp;</p>\r\n</p>\r\n</p>",
    "PostedDate": "2009-08-24T07:26:13.16-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "259537",
    "ThreadId": "63188",
    "Html": "<p>hi every time i extract any game or some big file it always used to show that the cabinet file require for the installation is crrupt it is problem with this pack or cd/dvd may be corrupt</p>\r\n<p>and the file get easily be extracted on met friends pc kindly help me pls</p>",
    "PostedDate": "2009-11-22T05:56:46.743-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "259544",
    "ThreadId": "63188",
    "Html": "<p>Sorry, I can't understand what you're asking.</p>\r\n<p>Also, I don't know anything about cabinet files. I think maybe you're in the wrong place.</p>\r\n<p>If you really are using DotNetZip, open a new discussion, ..pls.</p>",
    "PostedDate": "2009-11-22T06:39:39.877-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]