[
  {
    "Id": "1200280",
    "ThreadId": "528213",
    "Html": "I'm using latest version of DotNetZip(v 1.9)<br />\n While creating  zip file from a  stream (memory stream), the resultant zip file generated cannot be extracted. I tried the default extract mechanism in windows as well as third party application like Winrar. But an bad exception is thrown 'get 0x80004005 Unspecified error'.<br />\n  Following is the code I used.<br />\n<pre><code>               MemoryStream memoryStream;              \n                using (ZipFile zipFile = new ZipFile())\n                {  \n                    memoryStream = new MemoryStream();\n                    zipFile.AddEntry(&quot;DA.pdf&quot;, mstream);\n                   \n                    zipFile.Save(memoryStream);\n\n                    memoryStream.Seek(0, SeekOrigin.Begin);\n                    memoryStream.Flush();\n                    File.WriteAllBytes(@&quot;E:\\\\ZipLoc\\\\A.zip&quot;, memoryStream.ToArray());\n\n                }</code></pre>\n\nThe 'mstream' is a byte array. The data in mstream is valid, as I had already checked the content of it by writing to a file. <br />\n   The reason why I saved the zip to another memoryStream(a MemoryStream) is for using it for creating an attachment of a mail.<br />\n  Please help.<br />\n",
    "PostedDate": "2014-01-28T21:58:51.253-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1236753",
    "ThreadId": "528213",
    "Html": "Hey, maybe this solve your problem...\r<br />\nBefore add stream to zip file, use method Seek<br />\n<pre><code>var path = path.Replace(&quot;.tmp&quot;, &quot;.zip&quot;);\n\n                using (var zip = new ZipFile { CompressionLevel = CompressionLevel.BestSpeed })\n                {\n                    var cont = 0;\n                    foreach (var stream in streams)\n                    {\n                        stream.Seek(0, SeekOrigin.Begin);\n                        zip.AddEntry(string.Format(&quot;File{0}.jpg&quot;, ++cont), stream);\n                    }\n\n                    zip.Save(path);\n                }</code></pre>\n\n",
    "PostedDate": "2014-04-22T13:05:29.957-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]