[
  {
    "Id": "901578",
    "ThreadId": "392344",
    "Html": "\r\n<p>&nbsp;</p>\r\n<pre><div style=\"color:black; background-color:white\"><pre>Response.Clear();\n            Response.BufferOutput = <span style=\"color:blue\">false</span>;  <span style=\"color:green\">// for large files</span>\n            String ReadmeText = <span style=\"color:#a31515\">&quot;This is a zip file dynamically generated at &quot;</span> &#43; System.DateTime.Now.ToString(<span style=\"color:#a31515\">&quot;G&quot;</span>);\n            <span style=\"color:blue\">string</span> filename = <span style=\"color:#a31515\">&quot;test.zip&quot;</span>;\n            Response.ContentType = <span style=\"color:#a31515\">&quot;application/zip&quot;</span>;\n            Response.AddHeader(<span style=\"color:#a31515\">&quot;content-disposition&quot;</span>, <span style=\"color:#a31515\">&quot;filename=&quot;</span> &#43; filename);\n\n            <span style=\"color:blue\">using</span> (ZipFile zip = <span style=\"color:blue\">new</span> ZipFile())\n            {\n                zip.AddEntry(<span style=\"color:#a31515\">&quot;Readme.txt&quot;</span>, ReadmeText);\n                zip.Save(Response.OutputStream);\n            }\n            Response.Close();\n</pre>\n</div>\nCopied with some minor changes from one of the examples. Error occurs on Zip.Save.<br><br>Stacktrace: &nbsp;&nbsp; at System.Web.HttpResponseStream.get_Position()<br>&nbsp;&nbsp; at Ionic.Zip.CountingStream..ctor(Stream stream) in c:\\DotNetZip\\Zip\\Shared.cs:line 728<br><br>The weirdest part is it still works. After I cancel VS debugging I'm able to download the zip file and it appears to be correct.<br><br>Let me know if you need any additional info or if I'm doing something wrong. :) Thanks.</pre>\r\n",
    "PostedDate": "2012-08-20T08:38:45.13-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "902112",
    "ThreadId": "392344",
    "Html": "<p>After a lot of internet searching (and bashing my face in trying to use an alternative solution) I found something about seekable and nonseekable streams. So long story short this works:</p>\r\n<p>var ms = new MemoryStream();<br />zip.Save(ms);<br />ms.Position = 0;<br />ms.CopyTo(Response.OutputStream);</p>\r\n<p>&nbsp;</p>\r\n<p>I &lt;3 dotnetzip. TY Cheeso.</p>",
    "PostedDate": "2012-08-21T13:36:19.347-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1083124",
    "ThreadId": "392344",
    "Html": "Would you be so kind as to post the code to obtain &quot;Response&quot;. I have a general idea, but can't get it to work...<br />\n",
    "PostedDate": "2013-08-21T07:21:33.553-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1122240",
    "ThreadId": "392344",
    "Html": "I want to Save Zip file to Specific Location at Server...It works fine but save at download folder at client machine ....Please Help me..Thanks in advance     \r<br />\n<pre><code>      ZipFile zip = new ZipFile();\n     List&lt;Attachment&gt; listattachments = email.Attachments;\n        int acount = attachments.Count;\n        for (int i = 0; i &lt; acount; i++)\n        {\n            zip.AddEntry(attachments[i].FileName, listattachments[i].Content);\n        }\n        Response.Clear();\n        Response.BufferOutput = false;\n        string zipName = String.Format(&quot;{0}.zip&quot;, message.Headers.From.DisplayName);\n        Response.ContentType = &quot;application/zip&quot;;\n        Response.AddHeader(&quot;content-disposition&quot;, &quot;attachment; filename=&quot; + zipName);\n        zip.Save(Response.OutputStream);\n        Response.End();        </code></pre>\n\n",
    "PostedDate": "2013-11-12T00:02:15.27-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]