[
  {
    "Id": "1064644",
    "ThreadId": "449089",
    "Html": "Hi, \r<br />\n<br />\nI have asp.net c# code which, on click, creates a zip file including some excel files generated on the fly. \r<br />\n<br />\nThe code works fine in Internet Explorer, the zip file is downloadable and the files inside open correctly.\r<br />\n<br />\nHowever when i click the button in Chrome or firefox, there is no luck and all that happens is that the page refreshs with the letters PK at the top.\r<br />\n<br />\nany help?\r<br />\n<br />\nbelow is an exerpt of what is happening;<br />\n<pre><code>using (ZipFile zipFile = new ZipFile())\n            {\n                foreach (var lll in List)\n                {\n                    Class currentClass = DBMLManager.Instance.ABC(lll.ID);\n\n                    if (currentClass.Type == &quot;THIS_TYPE&quot;)\n                    {\n                        List&lt;uspProcClass&gt; Details = Manager.Instance.Report(ID, lll.ID);\n\n                        if (Details.Count &gt; 0)\n                        {\n                            string fileName = &quot;Report.pdf&quot;;\n                            MemoryStream myMemoryStream = new MemoryStream();\n                            MemoryStream newMemoryStream = Invoice.GenerateInvoiceForZip(lll.ID, myMemoryStream);\n                            byte[] docDat = newMemoryStream.ToArray();\n\n                            HttpContext.Current.Response.Clear();\n                            HttpContext.Current.Response.ContentType = &quot;application/PDF&quot;;\n                            HttpContext.Current.Response.AddHeader(&quot;content-disposition&quot;, string.Format(&quot;attachment; filename=testdoc.pdf&quot;));\n\n                            zipFile.AddEntry(fileName, docDat);\n                            Response.ClearContent();\n                            Response.ClearHeaders();\n                            Response.AppendHeader(&quot;content-disposition&quot;, &quot;attachment; filename=&quot; + zipName + &quot;.zip&quot;);\n                        }\n                    }                    \n                }\n\n                zipFile.Save(Response.OutputStream);\n                HttpContext.Current.Response.End();\n            }</code></pre>\n\nThanks\r<br />\n<br />\nChurni<br />\n",
    "PostedDate": "2013-07-04T10:11:18.313-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1065025",
    "ThreadId": "449089",
    "Html": "Hi Churni,\r<br />\n<br />\nFrom memory, Response.End() doesn't flush the buffer response buffer. You can either disable the response buffer with &quot;Response.BufferOutput = false;&quot;, or call something like Response.OutputStream.Flush(), or end the response cleanly with HttpApplication.CompleteRequest.\r<br />\n<br />\nThere's a similar thread at <a href=\"https://dotnetzip.codeplex.com/discussions/238541\" rel=\"nofollow\">https://dotnetzip.codeplex.com/discussions/238541</a> which might be useful.\r<br />\n<br />\nHope this helps.\r<br />\n<br />\nMike<br />\n",
    "PostedDate": "2013-07-05T14:20:48.453-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]