title: Writing MemoryStream to Response Object
body: <p>I am using the following code to stream pptx which is in a MemoryStream object but when I open it I get Repair message in PowerPoint, what is the correct way of writing MemoryStream to Response Object?</p>
  
  <pre><code>HttpResponse response = HttpContext.Current.Response;
  response.Clear();
  response.AppendHeader("Content-Type", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
  response.AppendHeader("Content-Disposition", string.Format("attachment;filename={0}.pptx;", getLegalFileName(CurrentPresentation.Presentation_NM)));                
  response.BinaryWrite(masterPresentation.ToArray());
  response.End();
  </code></pre>