title: How to see the uncompressed size before unpacking
body: <p>I am using DotNetZip to extract zip files that come from an extenal (not trustworthy) source. My problem is that the zip file itself can be a couple of kilobytes, but the unzipped content can become petabytes. How to see the uncompressed size before unpacking? Is there a reliable way to see this and prevent a OutOfMemoryException?</p>
  
  <p>As suggested below it can be done with ionic zip:</p>
  
  <pre><code>using (ZipFile zip = ZipFile.Read(zipFile))
                  {
                   // Option 2 - will need to sift through the mass of info
  
                   info = zip.Info;
  
  foreach (ZipEntry e in zip)
                      {
                          long uncompressedsize = e.UncompressedSize;
                          // Option 1
                          totaluncompressedsize += uncompressedsize;
                      }
                   }
  </code></pre>
  
  <p>But the question remains: Is the <code>UncompressedSize</code> completely reliable? Can someone change this information to make it appear as a small uncompressed size?</p>