This solution on StackOverflow[
^] is for Word documents, but the same approach will apply here:
var memoryStream = new MemoryStream();
using (FileStream fileStream = File.OpenRead(file))
{
fileStream.CopyTo(memoryStream);
}
memoryStream.Position = 0;
using (PresentationDocument presentationDocument = PresentationDocument.Open(memoryStream, true))
{
... Change the presentation here ...
presentationDocument.Close();
}
memoryStream.Position = 0;
Response.ContentType = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
Response.AddHeader("Content-Disposition", "attachment; filename=" + "cccc.pptx");
memoryStream.CopyTo(Response.OutputStream);