Writing MemoryStream to Response Object

colors

New Member
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?\[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\]
 
Back
Top