title: Using memorystream and DotNetZip in MVC gives "Cannot access a closed Stream"
body: <p>I'm trying to create a zipfile in a MVC method using the DotNetZip components.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    public FileResult DownloadImagefilesAsZip()
      {
          using (var memoryStream = new MemoryStream())
          {
              using (var zip = new ZipFile())
              {
                  zip.AddDirectory(Server.MapPath("/Images/"));
                  zip.Save(memoryStream);
  
                  return File(memoryStream, "gzip", "images.zip");
              }
          }
      }
  </code></pre>
  
  <p>When I run it I get a "Cannot access a closed Stream" error, and I'm not sure why.</p>