We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Issue: Presentation Save using http response causes any ppt/pptx file to need repair on open

I am currently using aspose slides to download power points from a file storage system we have via a Http response. In which I am setting the headers on the response to:
context.Response.ClearHeaders();
context.Response.ClearContent();
context.Response.AppendHeader(“Cache-Control”, “max-age=0”);
context.Response.AppendHeader(“Content-Type”, “application/force-download”);
context.Response.AppendHeader(“Content-Type”, “application/octet-stream”);
context.Response.AppendHeader(“Content-Type”, “application/download”);
context.Response.AppendHeader(“Content-Transfer-Encoding”, “binary”);
context.Response.AppendHeader(“Content-Disposition”,
string.Format(“attachment; filename=”{0}"", fileInfo.FileName));

I am currently creating a new presentation using a MemoryStream and then save the presentation using a http response and the file name.

When the download finishes and I go to open the file it says it needs repair. This happens with a new blank presentation with nothing in it.

@Kmjohnson74,

I have observed your comments. Can you please share source presentation, generated presentation along with environment details and please share which Aspose.Slides version you are using on your end. Also please share source code so that we may further investigate to help you out.

Attached are the 2 power points pre and post download and source code

powerpoint examplesand code.zip (62.5 KB)
.
This was using Aspose.Slides 17.10.0. This was in our Dev and Production Environments. Using Powerpoint 2016.

@Kmjohnson74,

I have observed your comments. A ticket with ID SLIDESNET-39531 has been logged in our issue tracking system to further investigate and resolve the issue.This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

@Kmjohnson74,

I like to inform that we have investigated issue to help you out. Please note, that there’s a method in Presentation class to write to HttpResponse. You don’t need to write presentation into any other sources first to generate correct HTTP response. Please share feedback with us if there is still an issue. It can be used like this:

private static void WriteRespone(Presentation pres, System.Web.HttpContext context, SaveFormat saveFormat, string fileName)
{
HttpResponse httpResponse = context.Response;
pres.Save(fileName, saveFormat, httpResponse, false);
}

The issues you have found earlier (filed as SLIDESNET-39531) have been fixed in this update.