[
  {
    "Id": "500614",
    "ThreadId": "229181",
    "Html": "<p>Hello, I am using the ZipOutStream on ASP.NET's Response.Filter property.&nbsp; Does this have any chance of working?</p>\r\n<p>When doing the below I get <em>You must call PutNextEntry() before calling Write().</em></p>\r\n<p><em></em>&nbsp;</p>\r\n<p>[WebService(Namespace = &quot;<a href=\"http://tempuri.org/\">http://tempuri.org/</a>&quot;)]<br>&nbsp;[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br>&nbsp;public class Default : IHttpHandler<br>&nbsp;{</p>\r\n<p>&nbsp;&nbsp;public void ProcessRequest(HttpContext context)<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;ZipOutputStream zipOutputStream = new ZipOutputStream(context.Response.Filter);<br>&nbsp;&nbsp;&nbsp;zipOutputStream.Password = &quot;mike&quot;;<br>&nbsp;&nbsp;&nbsp;context.Response.Filter = zipOutputStream;</p>\r\n<p>&nbsp;&nbsp;&nbsp;context.Response.ContentType = &quot;application/zip&quot;;<br>&nbsp;&nbsp;&nbsp;context.Response.AddHeader(&quot;Content-Type&quot;, &quot;application/zip&quot;);<br>&nbsp;&nbsp;&nbsp;context.Response.AddHeader(&quot;Content-disposition&quot;, string.Format(&quot;attachment; filename={0}&quot;, &quot;zzz.zip&quot;));</p>\r\n<p>&nbsp;&nbsp;&nbsp;WebRequest webRequest = WebRequest.Create(&quot;<a href=\"http://hril.gue.hibm.hsbc:8181/\">http://www.google.com</a>&quot;);<br>&nbsp;&nbsp;&nbsp;WebResponse webResponse = webRequest.GetResponse();</p>\r\n<p>&nbsp;&nbsp;&nbsp;using (StreamReader streamReader = new StreamReader(webResponse.GetResponseStream()))<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;string line;<br>&nbsp;&nbsp;&nbsp;&nbsp;while ((line = streamReader.ReadLine()) != null)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.Response.Write(line);<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;}</p>\r\n<p>&nbsp;&nbsp;}</p>\r\n<p>&nbsp;&nbsp;public bool IsReusable<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;get<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;return false;<br>&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;}<br>&nbsp;}</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-09-30T10:26:05.627-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "500757",
    "ThreadId": "229181",
    "Html": "Maybe.  I've never tried ZipOutputStream as an aspnet filter. Also,  I'm not sure I know what you're intending to accomplish. \r\n\r\nBut for sure, you need to call PutNextEntry() before any calls to Write() get made.  If I were you,  I'd try calling PutNextEntry right after calling the ZipOutputStream constructor.  Check the examples for how to do it.\r\n\r\nGood luck.  ",
    "PostedDate": "2010-09-30T17:13:16.573-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]