我正在使用以下代码流式传输 MemoryStream 对象中的 pptx,但是当我打开它时,我在 PowerPoint 中收到修复消息,将 MemoryStream 写入响应对象的正确方法是什么?
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();