[
  {
    "Id": "619232",
    "ThreadId": "259241",
    "Html": "<p>Hi,</p>\n<p><span>When</span><span> I add to </span><span>Zip </span><span>big files&nbsp;it</span><span class=\"str\">'s take a long time until it'</span><span>s making a zipFile on running time</span><span>,</span></p>\n<p><span>How</span><span>to make the creation of the&nbsp;zip file&nbsp;faster on running time?</span></p>\n<p><span>&nbsp;</span><span>I did this:</span></p>\n<p><span></span>\n<p>&nbsp;</p>\n<p><span>Thanks</span><span>..</span></p>\n</p>\n<div style=\"background-color: white; color: black;\">\n<pre><span style=\"color: blue;\">protected</span> <span style=\"color: blue;\">void</span> btnDownload_Click(<span style=\"color: blue;\">object</span> sender, EventArgs e) \r\n    { \r\n        Response.Clear(); \r\n        Response.ContentType = <span style=\"color: #a31515;\">\"application/zip\"</span>; \r\n        Response.AddHeader(<span style=\"color: #a31515;\">\"content-disposition\"</span>, <span style=\"color: #a31515;\">\"filename=\"</span> + <span style=\"color: #a31515;\">\"Test.zip\"</span>); \r\n \r\n \r\n        <span style=\"color: blue;\">using</span> (ZipFile zip = <span style=\"color: blue;\">new</span> ZipFile()) \r\n        { \r\n            FileList objFileList = <span style=\"color: blue;\">new</span> FileList(); \r\n \r\n            objFileList = FileList.GetList(Convert.ToInt32(TextBox1.Text)); \r\n \r\n            <span style=\"color: blue;\">for</span> (<span style=\"color: blue;\">int</span> i = 0; i &lt; objFileList.Count; i++) \r\n            { \r\n                zip.AddFile(Server.MapPath(<span style=\"color: #a31515;\">\"~/Files/\"</span> + objFileList[i].UniqueFileName)); \r\n                i++; \r\n            } \r\n            zip.Save(Response.OutputStream); \r\n        } \r\n    }\r\n</pre>\n</div>",
    "PostedDate": "2011-05-27T03:59:25.783-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "619493",
    "ThreadId": "259241",
    "Html": "<p>It takes a long time to compress many many files.</p>\r\n<p>If you do it often you can cache the results, and then you don't need to create the file, with each new request.&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-05-27T11:44:16.36-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "619547",
    "ThreadId": "259241",
    "Html": "<p>So I should Create the Zip file at server and save it for downloading it later?</p>\r\n<p>that what ur telling me?</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-05-27T13:43:43.573-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "620036",
    "ThreadId": "259241",
    "Html": "<p>Well yes, that is one way to make it faster.</p>",
    "PostedDate": "2011-05-29T13:35:56.09-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]