[
  {
    "Id": "431635",
    "ThreadId": "209481",
    "Html": "<p>The project I am working on is using ASP2.0&nbsp;, The web page allows users to choose files and then upload them. After the files are uploaded they are added to a zip file then saved on a file server for storage.&nbsp; I have everthing working the way it should, files are uploaded , added to a zip then saved to a file server.&nbsp; The users are shown a progress bar while all of this is taking place.&nbsp;The progress bar as of now shows&nbsp;the upload progress but not the zipping&nbsp;progress.&nbsp;&nbsp;Im not quite sure what I will show in the progress bar for zipping as of yet (bytes saved or files saved or what ever will let the user know that something is happening). My problem is is that I have no clue as to how to&nbsp;set a variable to something such as&nbsp;&nbsp;ZipProgressEventArgs.TotalBytesToTransfer&nbsp;&nbsp;. So that I have something to reference the actual progress against.&nbsp;So maybe this is more of a VB syntax question. I have looked over the examples in the help file and cannot figure out how to access these attributes.&nbsp; Thanks&nbsp; in advance for the help.</p>",
    "PostedDate": "2010-04-15T13:06:08.307-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "433734",
    "ThreadId": "209481",
    "Html": "<p>When you say &quot;ASP2.0&quot; , do you mean ASP.NET ?</p>\r\n<p>I don't know what you mean by &quot;I have no clue as to how to&nbsp;set a variable to something such as&nbsp;&nbsp;ZipProgressEventArgs.TotalBytesToTransfer&quot;.</p>\r\n<p>TotalBytesToTransfer is a long, System.Int64.&nbsp; To assign a variable, the value contained in that field, you just do this:</p>\r\n<div style=\"color:black;background-color:white\">\r\n<pre> <span style=\"color:blue\">Dim</span> variable <span style=\"color:blue\">as</span> Int64 = e.TotalBytesToTransfer\r\n</pre>\r\n</div>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-04-21T09:13:18.563-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "433764",
    "ThreadId": "209481",
    "Html": "<p>Cheeso,</p>\r\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hey thanks for the reply . Yes I do mean ASP.Net ... as far as how to assign a variable I undestand how to do that. I am just not sure how to get the value of ZipProgressEventArgs.TotalBytesToTranfer&nbsp;into a variable.&nbsp;It throws <em>Object reference not set to an instance of an object error.</em> Here is my error sample code</p>\r\n<p><span style=\"font-family:Consolas;font-size:x-small\"><span style=\"font-family:Consolas;font-size:x-small\"><span style=\"font-family:Consolas;font-size:x-small\">\r\n<p>&nbsp;</p>\r\n</span></span></span></p>\r\n<p><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\">Protected</span></span></span><span style=\"font-family:Consolas;font-size:x-small\"><span style=\"font-family:Consolas;font-size:x-small\"> </span></span><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\">Sub</span></span></span><span style=\"font-family:Consolas;font-size:x-small\"><span style=\"font-family:Consolas;font-size:x-small\"> Button1_Click(</span></span><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\">ByVal</span></span></span><span style=\"font-family:Consolas;font-size:x-small\"><span style=\"font-family:Consolas;font-size:x-small\"> sender </span></span><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\">As</span></span></span><span style=\"font-family:Consolas;font-size:x-small\"><span style=\"font-family:Consolas;font-size:x-small\"> </span></span><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\">Object</span></span></span><span style=\"font-family:Consolas;font-size:x-small\"><span style=\"font-family:Consolas;font-size:x-small\">, </span></span><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\">ByVal</span></span></span><span style=\"font-family:Consolas;font-size:x-small\"><span style=\"font-family:Consolas;font-size:x-small\"> e </span></span><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\">As</span></span></span><span style=\"font-family:Consolas;font-size:x-small\"><span style=\"font-family:Consolas;font-size:x-small\"> System.</span></span><span style=\"font-family:Consolas;color:#2b91af;font-size:x-small\"><span style=\"font-family:Consolas;color:#2b91af;font-size:x-small\"><span style=\"font-family:Consolas;color:#2b91af;font-size:x-small\">EventArgs</span></span></span><span style=\"font-family:Consolas;font-size:x-small\"><span style=\"font-family:Consolas;font-size:x-small\">) </span></span><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\">Handles</span></span></span><span style=\"font-family:Consolas;font-size:x-small\"> </span>\r\n<p><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Segoe UI;color:#000000;font-size:x-small\">using zip as New ZipFile()</span></span></span></span></span></p>\r\n<p><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Segoe UI;color:#000000;font-size:x-small\">zip.Name = zipfilename</span></span></span></span></span></p>\r\n<p><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Segoe UI;color:#000000;font-size:x-small\">zip.AddItem(filetozip)</span></span></span></span></span></p>\r\n<p><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Segoe UI;color:#000000;font-size:x-small\">dim zipevents as ZipProgressEventArgs</span></span></span></span></span></p>\r\n<p><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Segoe UI;color:#000000;font-size:x-small\">dim zipTotal_Bytes as zipevents.TotalBytesToTransfer</span></span></span></span></span></p>\r\n<p><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Segoe UI;color:#000000;font-size:x-small\">zip.Save(zipfilepath &amp; zip.Name)</span></span></span></span></span></p>\r\n<p><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Segoe UI;color:#000000;font-size:x-small\">End Sub</span></span></span></span></span>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</p>\r\n<p><span style=\"color:#000000\">&nbsp;</span></p>\r\n<p><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\"><span style=\"font-family:Consolas;color:#0000ff;font-size:x-small\">&lt;font face=&quot;Consolas&quot; size=&quot;2&quot; color=&quot;#0000ff&quot;&gt;\r\n<p><span style=\"color:#000000\">&nbsp;</span></p>\r\n&lt;/font&gt;</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>\r\n</p>\r\n<p><span style=\"font-family:Consolas;font-size:x-small\">Button1.Click</span></p>",
    "PostedDate": "2010-04-21T10:21:31.233-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "433891",
    "ThreadId": "209481",
    "Html": "<div style=\"width:800px\">\r\n<p>Right, ok.&nbsp;&nbsp; I think this is a misunderstanding of VB syntax and how to use the library.</p>\r\n<p>The ZipProgressEventArgs is a type.</p>\r\n<p>By using &quot;dim zipevents as ZipProgressEventArgs&quot; in your code, you are defining a variable named zipevents and tell the compiler that it is of a particular type (ZipProgressEventArgs).&nbsp; You don't assign a value, which means the variable has a value of <strong>Nothing</strong>.&nbsp;&nbsp;&nbsp;You're getting an exception by referencing a field in that object, because the object is Nothing.</p>\r\n<p>What you need to do is define a progress event.&nbsp; The way events work in .NET in general,&nbsp; is the way DotNetZip uses them.&nbsp; The method you call, ZipFile.Save(), will invoke YOUR code with progress updates, at various times as the save proceeds.&nbsp; You need to provide a method, for ZipFile.Save() to call.&nbsp;&nbsp;&nbsp; That method is of type <strong>EventHandler(Of ZipProgressEventArgs)</strong>.&nbsp; And you need to provide it by setting the ZipFile.SaveProgress property.</p>\r\n<p>See <a href=\"http://cheeso.members.winisp.net/DotNetZipHelp/html/2b8624b0-6823-7e33-a864-2c7bbd9835e7.htm\">http://cheeso.members.winisp.net/DotNetZipHelp/html/2b8624b0-6823-7e33-a864-2c7bbd9835e7.htm</a>&nbsp;</p>\r\n<p>There's VB code on that documentation page.</p>\r\n<p>Now, you're using ASPNET, so I'm not sure how you will communicate that progress back to the requesting client browser.&nbsp; I don't know how the progressbar works with ASPNET, but I think it uses jQuery.&nbsp; And my understanding is the jQuery progressbar needs to poll to the server to request progress updates. Therefore your code would have to stash the progress in its SaveProgress event, and then provide that stashed value if it receives a request for progress update from the browser.&nbsp; A little complicated.</p>\r\n<p>And... depending on the size of the zip file, and the stream you save into, this save may be very quick.&nbsp; If you are saving to the filesystem, the save might take 2 seconds, even for a fairly large file.&nbsp; So, consider whether you're sure you want the progress bar on the browser side to indicate save progress on the server side.&nbsp; The communication overhead alone may dwarf the time required to simply save the zip file, if you see what I mean.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n</div>",
    "PostedDate": "2010-04-21T14:35:37.65-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "434338",
    "ThreadId": "209481",
    "Html": "<p>Worked like a charm cheeso!!. Im using a custom progress bar to show the progress on the web page. I just plugged in e.bytestransferred and e.totalbytestransfered to its properties and it works without a hitch. I know that it may slow it down a bit to show the progress to the end user but I dont want people leaving the page thinking that there is an error because that will cause problems with other things that happen after the files are zipped.&nbsp; Thanks again for the explanation for this .</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-04-22T13:30:58.957-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "434820",
    "ThreadId": "209481",
    "Html": "<p>Sweet!&nbsp; glad it worked for you.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-04-23T15:33:48.607-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]