Powerpoint cant open because part of the file is missing

Hi

I am downloading the generated owerpoint in my web application.
On the download window,…there are two options “open” and “save”.

When i click on open and open the powerpoint and try to click on File > Save as , I am able to save it.
But im not able to open this saved powerpoint as I get the following error

Powerpoint cant open C:\Documents and Settings\GaeaGlobal\Desktop\Verizon.ppt because part of the file is missing.

Dear vamsee,

Please mention the version of Aspose.Slides for JAVA and provide a source code example and any source presentation(s) if used by you.

HI

The version number mentioned in the licence file is 2.1

Im using the following code to send the powerpoin in the response

private void sendPowerPointAsResponse (
HttpServletResponse response, String finalPresentationFileName,User user,CompanyDetailBean combean)
throws FileNotFoundException, IOException,Exception {
FileInputStream fis=null;
PrintWriter out=null;
try{

response.setContentType(“application/vnd.ms-powerpoint”);

String companyname=combean.getCompanyname();

String attachment=“Attachment;filename=”+companyname+"_"+user.getFirstname()+" “+user.getLastname()+”.ppt";
//String attachment=“Attachment;filename=”+finalPresentationFileName;
response.addHeader(“Content-Disposition”, attachment);
File file = new File(finalPresentationFileName);
fis = new FileInputStream(file);
out = response.getWriter();
int i;
while ((i = fis.read()) != -1) {
out.write(i);
}

}catch(FileNotFoundException fnfe){
logdata.error("CreatePptAction:sendPowerPointAsResponse FileNotFoundException "+fnfe.getMessage());
//throw new FileNotFoundException("from CreatePptAction:sendPowerPointAsResponse "+fnfe.getMessage());
}catch(SocketException se){
logdata.error("CreatePptAction:sendPowerPointAsResponse SocketException "+se.getMessage());
}catch(Exception ex){
logdata.error("CreatePptAction:sendPowerPointAsResponse Exception "+ex);
//throw new Exception("from CreatePptAction:sendPowerPointAsResponse "+ex.getMessage());
}finally{
try{
// out.flush();
out.close();
fis.close();
// response.flushBuffer();
}catch(Exception ex){
logdata.error("CreatePptAction:sendPowerPointAsResponse when closing "+ex.getMessage());
//throw new Exception("from CreatePptAction:sendPowerPointAsResponse when closing out "+ex.getMessage());
}
}

}

The powerpoint has been generated by collating different slides.


Dear vamsee,

Please download the latest version of Aspose.Slides for JAVA, which is 1.8.2.0 from this link.

http://www.aspose.com/community/files/51/aspose.slides/entry107092.aspx

http://www.aspose.com/community/files/51/aspose.slides/entry107091.aspx

If problem persists; then let me know your code which is generating your presentation, I will also need your source presentation(s) which could reproduce this bug. Also, are you deleting unused masters from your final presentation? In that case, call Presentation.deleteHandout() after Presentation.deleteUnusedMasters() method.