[
  {
    "Id": "446991",
    "ThreadId": "213737",
    "Html": "<p>I'm using SaveProgress right now to get the OVERALL percentage of the entire zip process.&nbsp; It works, however, it seems that SaveProgress only report each file.</p>\r\n<p>How can I make it report the overall bytes? Each time I add a file, do I need to get the length and manage a &quot;overall&quot; length for all of the files I add?</p>\r\n<p><br>Here is my code:</p>\r\n<p>\r\n<div style=\"color:black;background-color:white\">\r\n<pre>        <span style=\"color:blue\">void</span> zFile_SaveProgress(<span style=\"color:blue\">object</span> sender, SaveProgressEventArgs e) {\r\n            <span style=\"color:blue\">if</span> (e.TotalBytesToTransfer != 0 &amp;&amp; e.BytesTransferred != 0) {\r\n                pTracker.BytesTotal = e.TotalBytesToTransfer;\r\n                pTracker.BytesLeft = e.BytesTransferred;\r\n                pTracker.PercentLeft = Convert.ToInt32((pTracker.BytesLeft * 100 / pTracker.BytesTotal));\r\n            }\r\n        }\r\n</pre>\r\n</div>\r\n</p>",
    "PostedDate": "2010-05-25T02:23:19.413-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "447308",
    "ThreadId": "213737",
    "Html": "<p>The ZipFile class, on which the SaveProgress event hangs,&nbsp;in the general case, does not &quot;know&quot; the size of any entry (either compressed or uncompressed) until the entry is saved.&nbsp;&nbsp; Sometimes, maybe most of the time, the entry is sourced from a filesystem file, in which case it would be easy to determine the length of the file.&nbsp;&nbsp; Sometimes though, the entry comes from a stream, and the length of the stream is not known, and cannot be known, until it is read.&nbsp; So there is no general, correct way for the ZipFile class to &quot;know&quot;, before the Save completes, how many bytes will be read and compressed as part of the Save.&nbsp; Do you see?&nbsp;&nbsp; &nbsp;</p>\r\n<p>If you have the situation where all of the entries in your ZipFile are filesystem files, then YES, you can keep track of that yourself and update a progress bar with that information.&nbsp; But ZipFile does not do that for you.</p>\r\n<p>I can imagine a modification to&nbsp;ZipFile where it provides what you want, if all of the entries are filesystem files. That would be convenient, I imagine.&nbsp; But today it does not do that.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-05-25T14:17:16.283-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "447310",
    "ThreadId": "213737",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=10940\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2010-05-25T14:17:56.167-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]