Is is possible to default Download PPT instead of saving in any location

Hi,

Is it possible to download directly PPT instead of saving in any location?

Regards,
Anand Gopal

Hi Anand,

I have observed the requirement shared by you and like to share that Aspose.Slides provide different overriding of Presentation.Save() method. One of which allows to save the presentation as stream. You can save the presentation as stream and perform the rest on your end. For reference, you can observe this documentation link as well. Please share, if I may help you further in this regard.

Many Thanks,

Thanks Mudassir ,


This link is very useful for me, and i wrote same way for saving like this,

public void saveFile(Aspose.Slides.Presentation pres,string PresentationName)
{
MemoryStream objMemoryStream = new MemoryStream();

pres.Save(objMemoryStream, Aspose.Slides.Export.SaveFormat.Pptx);

byte[] buffer = objMemoryStream.ToArray();

HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.AddHeader(“Content-disposition”, “attachment; filename=”" +PresentationName + “”.pptx");
HttpContext.Current.Response.ContentType = “application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”;
HttpContext.Current.Response.AddHeader(“Content-Length”, buffer.Length.ToString());
HttpContext.Current.Response.BinaryWrite(buffer);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.Close();
}

Its working for me.

Regards,
Anand Gopal

Hi Anand Gopal,


It is good to know that things are resolved on your end. Please share if I may help you further in this regard.

Many Thanks,