Free Support Forum - aspose.com

Export of ppt Error

I am currently experiancing a problem with exporting a powerpoint file. Below is the code used to export the file:

private void exportButton_Click(object sender, EventArgs e)
{
this.Response.Clear();
this.Response.ContentType = “application/vnd.ms-powerpoint”;
this.Response.AddHeader(“Content-Disposition”, “attachment; filename=Presentation.ppt”);
this.Response.Flush();
PPT_SESSION.Presentation.Export(this.Response.OutputStream);
this.Response.End();
}

The file is then created and either opened or saved. The file size appears normal however when the .ppt file is opened it gives the following error: "Powerpoint Can’t read C:…\Presentation.ppt."

Has anyone else had this problem?

Which version of Aspose.Slides you are using, because I don’t see any Export API.

Please try this code; it works fine at my end and let me know about it.

*****************************

this.Response.Clear();

this.Response.ContentType = "application/vnd.ms-powerpoint";

this.Response.AppendHeader("Content-Disposition", "attachment; filename=demo.ppt");

this.Response.Flush();

System.IO.Stream st = this.Response.OutputStream;

// Send the file

pres.Write(st);

this.Response.End();