[
  {
    "Id": "662615",
    "ThreadId": "270207",
    "Html": "\r\n<p>I'm trying to return zipped file</p>\r\n<p></p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre><span style=\"color:blue\">public</span> FileResult Download()\r\n        {\r\n            MemoryStream outputStream = <span style=\"color:blue\">new</span> MemoryStream();\r\n\r\n            <span style=\"color:blue\">using</span> (ZipFile zip = <span style=\"color:blue\">new</span> ZipFile())\r\n            {\r\n                zip.AddEntry(<span style=\"color:#a31515\">&quot;asdasd.html&quot;</span>, <span style=\"color:#a31515\">&quot;&lt;html&gt;&lt;body&gt;fgdfg&lt;/body&gt;&lt;/html&gt;&quot;</span>);\r\n                zip.AddEntry(<span style=\"color:#a31515\">&quot;asdassssd.html&quot;</span>, <span style=\"color:#a31515\">&quot;&lt;html&gt;&lt;body&gt;asddsaf&lt;/body&gt;&lt;/html&gt;&quot;</span>);\r\n              \r\n                zip.Save(outputStream);\r\n            }\r\n\r\n            outputStream.Seek(0, SeekOrigin.Begin);\r\n\r\n            <span style=\"color:blue\">return</span> <span style=\"color:blue\">new</span> FileStreamResult(outputStream, <span style=\"color:#a31515\">&quot;application/zip&quot;</span>) { FileDownloadName = <span style=\"color:#a31515\">&quot;templates.zip&quot;</span> };\r\n\r\n        }\r\n</pre>\r\n</div>\r\n<p></p>\r\n<p>But file there is no file..</p>\r\n<p>Fiddler's RawView:</p>\r\n<p>HTTP/1.1 200 OK<br>\r\nServer: ASP.NET Development Server/10.0.0.0<br>\r\nDate: Wed, 24 Aug 2011 11:25:56 GMT<br>\r\nX-AspNet-Version: 4.0.30319<br>\r\nX-AspNetMvc-Version: 3.0<br>\r\nContent-Disposition: attachment; filename=hey.zip<br>\r\nCache-Control: private, s-maxage=0<br>\r\nContent-Type: application/zip<br>\r\nContent-Length: 422<br>\r\nConnection: Close<br>\r\n<br>\r\nPK&#3;&#4;&#20;���&#8;�&lt;s&#24;?��e&amp;&#26;���&#31;���<br>\r\n�$�asdasd.html<br>\r\n� �����&#1;�&#24;�����Pb�&#1;����Pb�&#1;����Pb�&#1;��(�ͱ�I�O��KKOIK��&#7;�m��&#18;�PK&#3;&#4;&#20;���&#8;�&lt;s&#24;?�&#26;��&#28;���!���&#14;�$�asdassssd.html<br>\r\n� �����&#1;�&#24;�M4��Pb�&#1;M4��Pb�&#1;M4��Pb�&#1;��(�ͱ�I�O��K,NI)NL��&#7;�l��R�PK&#1;&#2;-�&#20;���&#8;�&lt;s&#24;?��e&amp;&#26;���&#31;���<br>\r\n�$���������������asdasd.html<br>\r\n� �����&#1;�&#24;�����Pb�&#1;����Pb�&#1;����Pb�&#1;PK&#1;&#2;-�&#20;���&#8;�&lt;s&#24;?�&#26;��&#28;���!���&#14;�$�����������g���asdassssd.html<br>\r\n� �����&#1;�&#24;�M4��Pb�&#1;M4��Pb�&#1;M4��Pb�&#1;PK&#5;&#6;����&#2;�&#2;�����������</p>\r\n<p>Help. please!</p>\r\n",
    "PostedDate": "2011-08-24T04:37:15.63-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "662750",
    "ThreadId": "270207",
    "Html": "<p>I don't know ASPNET MVC so well, but it sure looks like, from Fiddler's perspective, there is a zipfile there.</p>\r\n<p>It looks like it's working.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-08-24T09:24:35.19-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "662752",
    "ThreadId": "270207",
    "Html": "<p>What I suggest, to help diagnmose and troubleshoot, is to send a MemoryStream that you fill with other content.&nbsp; Content not from a ZipOutputStream.</p>\r\n<p>See if the FileStreamResult works with that content. then, when you get that sorted, add the ZipOutputStream back in.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-08-24T09:25:36.567-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "663075",
    "ThreadId": "270207",
    "Html": "<p>i'm sorry. The problem was that I called controller via ajax&nbsp;$.post</p>\r\n<p>now I call it (like clicking a link):</p>\r\n<p><span style=\"font-family: Consolas; font-size: x-small;\">\r\n<div style=\"color: black; background-color: white;\">\r\n<pre>window.location.href = <span style=\"color: #a31515;\">'@Url.Action(\"Download\", \"Template\")?templates='</span> + allVals\r\n\r\n\r\n</pre>\r\n</div>\r\n</span></p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-08-25T00:51:17.85-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "663251",
    "ThreadId": "270207",
    "Html": "<p>and it works now?&nbsp;</p>\r\n<p>There's no reason why an AJAX call shouldn't also work.&nbsp; On the other hand, if you're using ajax in the traditional way, then&nbsp;you'd be getting a zipfile into the Javascript program space in the browser, and you'd need to read the zipfile from that environment.&nbsp; Which is not so simple.</p>",
    "PostedDate": "2011-08-25T07:22:15.69-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]