title: Zip Content Type in a Response with Firefox And Chrome
body: <p>I'm writing an application for Sharepoint that implements a button on a ribbon to download multiple files as a zip...</p>
  
  <p>Everything goes fine, everything goes well... But when I tried to download the zip with with Chrome or Firefox they do nothing..</p>
  
  <p>My code is this:</p>
  
  <pre><code>private void WriteStreamToResponse(MemoryStream ms)
      {
          if (ms.Length &gt; 0)
          {
              string filename = DateTime.Now.ToFileTime().ToString() + ".zip";
              Response.Clear();
              Response.ClearHeaders();
              Response.ClearContent();
              Response.ContentType = "application/zip"; //also tried application/octect and application/x-zip-compressed
              Response.AddHeader("Content-Length", ms.Length.ToString());
              Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
  
              byte[] buffer = new byte[65536];
              ms.Position = 0;
              int num;
              do
              {
                  num = ms.Read(buffer, 0, buffer.Length);
                  Response.OutputStream.Write(buffer, 0, num);
              }
  
              while (num &gt; 0);
  
              Response.Flush();
          }
      }
  </code></pre>