[
  {
    "Id": "453630",
    "ThreadId": "215493",
    "Html": "<p>I am needing to ship some files over webservices. The pseudocode goes like this;</p>\r\n<ol>\r\n<li>The client calls the webservice method to get the files</li>\r\n<li>The web method <ol>\r\n<li>Zips the files</li>\r\n<li>Save&nbsp;the zip&nbsp;as a stream</li>\r\n<li>Converts the stream to a byte array </li>\r\n<li>Returns the byte array. </li>\r\n</ol></li>\r\n<li>The client <ol>\r\n<li>Converts the byte array to a zip</li>\r\n<li>Extracts the files from the zip</li>\r\n</ol></li>\r\n</ol>\r\n<p>This is what I have so far:&nbsp;</p>\r\n<div style=\"color:black;background-color:white\">\r\n<pre>Ionic.Zip.ZipFile ServerZip = <span style=\"color:blue\">new</span> Ionic.Zip.ZipFile();\r\n<span style=\"color:blue\">string</span>[] FilesToZip = <span style=\"color:blue\">null</span>;\r\nFilesToZip = System.IO.Directory.GetFiles(<span style=\"color:#a31515\">&quot;c:\\\\temp\\\\somefiles&quot;</span>);\r\nServerZip.AddFiles(FilesToZip);\r\nSystem.IO.MemoryStream ServerStream = <span style=\"color:blue\">new</span> System.IO.MemoryStream();\r\nServerZip.Save(ServerStream);\r\n<span style=\"color:blue\">byte</span>[] FileData = ServerStream.ToArray();\r\n\r\n</pre>\r\n</div>\r\n<p>Now, how do I create a new zip file using a stream or byte array? There is no New() parameters that accept a stream/byte array.</p>\r\n<p>Thanks for the help!</p>\r\n<p>Aaron</p>",
    "PostedDate": "2010-06-09T10:42:12.47-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "453644",
    "ThreadId": "215493",
    "Html": "<p>I got my answer by perusing the discussions. I had already perused, but like most times, I think of better search terms after I post a message.</p>\r\n<pre>System.IO.MemoryStream ClientStream = new System.IO.MemoryStream(FileData);\r\nIonic.Zip.ZipFile ClientZip = Ionic.Zip.ZipFile.Read(ClientStream);\r\nClientZip.ExtractAll(&quot;c:\\\\temp\\\\&quot;);\r\n</pre>",
    "PostedDate": "2010-06-09T11:22:05.747-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]