[
  {
    "Id": "473922",
    "ThreadId": "221759",
    "Html": "<p>Hello,</p>\r\n<p>&nbsp;</p>\r\n<p>I have some users complaining that they receive a &quot;file is corrupt&quot; error when they open a zip file that has been zipped and downloaded. I have not been able to reproduce this issue. Was wondering if someone may check my code to see if I have something that is causing the issue?</p>\r\n<p>Thanks,</p>\r\n<p>&nbsp;</p>\r\n<p>\r\n<div style=\"color:black;background-color:white\">\r\n<pre>void MyButton_Click(Object source, EventArgs e)\r\n{\r\n\tServer.ScriptTimeout = 3600000;\r\n    TreeNodeCollection checkedNodes = MyTree.CheckedNodes;\r\n    MyDataList.DataSource = checkedNodes;\r\n    MyDataList.DataBind();\r\n\r\n    Response.Clear();\r\n\tResponse.BufferOutput = false;  \r\n    String sMappedPath = Request.MapPath(&quot;users&quot;);\r\n  Path.GetFileName(file);\r\n    System.Web.HttpContext c = System.Web.HttpContext.Current;\r\n    String ReadmeText = String.Format(&quot;This is a zip file that was dynamically generated at Spencebothers.com on {0}\\n The files that you checked are included in this zip file.&quot;,\r\n                                     System.DateTime.Now.ToString(&quot;G&quot;),\r\n                                     System.Environment.MachineName,\r\n                                     c.Request.ServerVariables[&quot;SERVER_SOFTWARE&quot;]\r\n                                     );\r\n    string archiveName = String.Format(&quot;SpenceBrothers-{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    \r\n    \r\n    using (ZipFile zip = new ZipFile())\r\n    {\r\n        foreach (TreeNode node in MyTree.CheckedNodes)\r\n        {\r\n        \r\n\t\tif (node.Value.Contains(&quot;.&quot;) == false)\r\n\t\t{\r\n                            zip.AddDirectory(System.IO.Path.Combine(sMappedPath, node.Value.Replace(&quot;~/users/&quot;, &quot;&quot;)),node.Text);\r\n\t\t\t}\r\n\t\t\telse if (node.Value.Contains(&quot;.&quot;) == true)\r\n\t\t\t{\r\n                zip.AddFile(System.IO.Path.Combine(sMappedPath, node.Value), &quot;&quot;);\r\n\t\t\t}\r\n\r\n        }\r\n        \r\n        zip.AddEntry(&quot;Readme.txt&quot;, ReadmeText);\r\n        zip.Save(Response.OutputStream);\r\n    }\r\n    Response.End();\r\n\r\n    \r\n}\r\n\r\n</pre>\r\n</div>\r\n</p>",
    "PostedDate": "2010-07-28T15:42:03.447-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "474195",
    "ThreadId": "221759",
    "Html": "I've seen this kind of thing before, particularly on Mac clients. \r\nThe zip app on Mac apparently has problems with bit 3 encoding.  \r\nThere was a thread of about 100 messages covering this; \r\nsearch the archives of this forum for details. There are workarounds\r\nand explanations.\r\n\r\nAlso Ive heard there is a browser cache corruption issue on some older versions of IE.\r\nThis is unrelated to DotNetZip, but as I remember it did specifically relate to zip files. \r\nTry searching other forums for info on that. \r\n\r\nYou'll have to do some research on your end about when and where the problem happens, \r\nto narrow things down. It might also help to retain the corrupted zipfile itself, so you can figure\r\nout just what is wrong with it.\r\n\r\n",
    "PostedDate": "2010-07-29T05:02:57.447-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "486335",
    "ThreadId": "221759",
    "Html": "<p>For me zip files are very important. And once something happened with some of them. Fortunately I stumbled upon a nice utility -&nbsp;<a href=\"http://www.recoverytoolbox.com/fix_winzip.html\">corrupt winzip file</a>. To my great surprise, it restored theirs within a minute and utterly simply.</p>",
    "PostedDate": "2010-08-30T03:07:28.28-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]