[
  {
    "Id": "430052",
    "ThreadId": "209063",
    "Html": "<p>I'm getting a corrupted zip file whenever i add a 91st entry file to download. Not 91 files to zip, but rather the 91st file available to download.</p>\r\n<p>What I have is a list of files, like the code shown below. I select the files I want to zip and download through the checkbox and then click submit. Everything seems to work ok, but if I had another file as seen below to the html list, any combination of files that i choose to download afterwards, will always give me a zip error.</p>\r\n<p>&nbsp;</p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre>\t<span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">tr</span> <span style=\"color:Blue\">&gt;</span>\r\n\t\t<span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">td</span> <span style=\"color:Red\">border</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;1&quot; width=&quot;&quot;</span> <span style=\"color:Red\">align</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">center</span><span style=\"color:Blue\">&gt;</span>\r\n\t    <span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">input</span> <span style=\"color:Red\">id</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;Checkbox89&quot;</span> <span style=\"color:Red\">name</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;multiple11&quot;</span> <span style=\"color:Red\">value</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;C:\\Inetpub\\wwwroot\\Webiz\\Portal\\Docs\\docs\\2008StdEnglishFinal.pdf&quot;</span> <span style=\"color:Red\">type</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;checkbox&quot; default=&quot;&quot;</span><span style=\"color:Blue\">/&gt;</span>\r\n\t    <span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">td</span><span style=\"color:Blue\">&gt;</span>\r\n\t\t\r\n\t\t<span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">td</span> <span style=\"color:Red\">border</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;1&quot;</span> <span style=\"color:Red\">width</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;8%&quot;</span> <span style=\"color:Red\">align</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">center</span><span style=\"color:Blue\">&gt;</span>\r\n\t\t<span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">p</span> <span style=\"color:Blue\">&gt;</span><span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">a</span> <span style=\"color:Red\">href</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;docs/2008StdEnglishFinal.pdf&quot;</span><span style=\"color:Blue\">&gt;</span>2008<span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">a</span><span style=\"color:Blue\">&gt;</span><span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">p</span><span style=\"color:Blue\">&gt;</span>\r\n\t\t<span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">td</span><span style=\"color:Blue\">&gt;</span>\r\n\r\n\t\t<span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">td</span> <span style=\"color:Red\">border</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;1&quot;</span> <span style=\"color:Red\">width</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;57%&quot;</span> <span style=\"color:Red\">align</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">left</span><span style=\"color:Blue\">&gt;</span>\r\n  \t\t<span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">p</span> <span style=\"color:Blue\">&gt;</span>2008StEnglishFinal<span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">p</span><span style=\"color:Blue\">&gt;</span>\r\n\t\t<span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">td</span><span style=\"color:Blue\">&gt;</span>\r\n\r\n\t\t<span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">td</span> <span style=\"color:Red\">border</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;1&quot;</span> <span style=\"color:Red\">width</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;17%&quot;</span> <span style=\"color:Red\">align</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">center</span><span style=\"color:Blue\">&gt;</span>\r\n  \t\t<span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">p</span> <span style=\"color:Blue\">&gt;</span>09/08<span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">p</span><span style=\"color:Blue\">&gt;</span>\r\n\t\t<span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">td</span><span style=\"color:Blue\">&gt;</span>\r\n\r\n\t\t<span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">td</span> <span style=\"color:Red\">border</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;1&quot;</span> <span style=\"color:Red\">width</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">&quot;18%&quot;</span> <span style=\"color:Red\">align</span><span style=\"color:Blue\">=</span><span style=\"color:Blue\">center</span><span style=\"color:Blue\">&gt;</span>\r\n  \t\t<span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">p</span> <span style=\"color:Blue\">&gt;</span><span style=\"color:Blue\">&lt;</span><span style=\"color:#A31515\">b</span><span style=\"color:Blue\">&gt;</span><span style=\"color:Red\">&amp;nbsp;</span><span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">b</span><span style=\"color:Blue\">&gt;</span><span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">p</span><span style=\"color:Blue\">&gt;</span>\r\n\t\t<span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">td</span><span style=\"color:Blue\">&gt;</span>\r\n\t<span style=\"color:Blue\">&lt;/</span><span style=\"color:#A31515\">tr</span><span style=\"color:Blue\">&gt;<br></span>&nbsp;</pre>\r\n</div>\r\n<p>This is the code i'm using to read from the form and write it to an array.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre>\t\tIf Request.Form(&quot;multiplebutton&quot;) = &quot;Download SA8000&quot; Then\r\n\t\t\r\n            If Not (Request.Form(&quot;multiple11&quot;) Is Nothing) Then\r\n                chkbox.Text = Request.Form(&quot;multiple11&quot;)\r\n            End If\r\n        End If\t\t\r\n             \r\n        \r\n        For Each s As String In Split(chkbox.Text, &quot;,&quot;)\r\n            vectorfic.Add(s)\r\n            \r\n        Next\r\n\r\n        \r\n        Dim archiveName As String = String.Format(&quot;archive-{0}.zip&quot;, DateTime.Now.ToString(&quot;yyyy-MMM-dd-HHmmss&quot;))\r\n        Response.ContentType = &quot;application/zip&quot;\r\n        Response.AddHeader(&quot;content-disposition&quot;, &quot;filename=&quot; + archiveName)\r\n      \r\n        Using zip As New ZipFile()\r\n        zip.AddFiles(vectorfic, &quot;&quot;)\r\n        zip.Save(Response.OutputStream)\r\n        End Using\r\n</pre>\r\n</div>\r\n<p>&nbsp;</p>\r\n<p>This is what WinRar is showing when I download the zip file.</p>\r\n<p>!&nbsp;&nbsp; C:\\Documents and Settings\\rui.matos\\Local Settings\\Temporary Internet Files\\Content.IE5\\LR1BQOGT\\archive-2010-Abr-12-161526[1].zip: Unexpected end of archive</p>\r\n<p>&nbsp;</p>\r\n<p>Funny thing is that if I add one more file to the list, it errors, if I remove one, everything works.</p>\r\n<p>&nbsp;</p>\r\n<p>Any idea if there is a limit?</p>\r\n<p>This is making no sense to me.</p>\r\n<p>&nbsp;</p>\r\n<p>EDIT: just noticed that if I remove one entry from the html list, hence listing 89 checkboxes, I can zip 4 files. If I try to zip 5 files, it gets corrupted. If i remove another checkbox, I can add 9 files!! This is so weird.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-04-12T08:25:46.35-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "430117",
    "ThreadId": "209063",
    "Html": "<p>I'm betting that there's html content that is dribbling into your Response.OutputStream, either before or after you write the zip file to it.&nbsp; <br>It seems random because the number of checkboxes affects the stream state.</p>\r\n<p>If I'm right, then you need to call Response.End() after the &quot;End Using&quot;.&nbsp; <br>If not Response.End, then some other way to close the Response, like&nbsp;HttpApplication.EndRequest().&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-04-12T10:43:28.6-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "430346",
    "ThreadId": "209063",
    "Html": "<p>guess what?</p>\r\n<p>response.end() seemed to solve it</p>\r\n<p>&nbsp;</p>\r\n<p>many thanks Cheeso.</p>\r\n<p>:)</p>",
    "PostedDate": "2010-04-13T01:34:38.373-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]