Free Support Forum - aspose.com

Saving ppt to Response stream

I am saving a ppt slide to the Response of a page with ASP.NET. Here's the code that does the saving:

page.Response.ContentType = "application/vnd.ms-powerpoint"

page.Response.AppendHeader("Content-Disposition", "attachment; filename=" & _Report.Name & ".ppt")

page.Response.Flush()

ppt.Write(page.Response.OutputStream)

page.Response.Flush()

This works pretty well. The page returns with a dialog to Open or Save the ppt. However, I ran into two issues with this.

1. I can not open the ppt directly by selecting the Open option in the dialog. I get a file path not found error. It is trying to open the ppt from Temporary Internet Files\Content.IE5\Some Random Folder and the file is not there. Is this an IE issue? I am using IE6

2. Any changes I made to controls on the page are not persisted. For example, if I add a listitem to a listbox control on the page prior and then write the ppt to the response stream, that listitem is lost when the page returns.

Sorry for delay.
1. I failed to reproduce first issue. I posted your code in created webproject and PowerPoint 2003 succesfully opened it from IE6.
2. Can you send me part of code, which you used to edit listbox?

1. I created a simple web app and sure enough, I can open the ppt without any problems. I will have to investigate what else I am doing in my other web app to have that problem.

2. For the listbox problem, it's pretty simple. Imagine a form with one listbox and one button. On the button's click event, add an listbox item and write a new ppt to the response stream. When the page returns, the item is not added.

'add item

ListBox1.Items.Add("Item")

'create new ppt

Dim ppt As New Aspose.Slides.Presentation

ppt.AddBodySlide()

'write ppt to response

Page.Response.ContentType = "application/vnd.ms-powerpoint"

Page.Response.AppendHeader("Content-Disposition", "attachment; filename=" & "Test" & ".ppt")

Page.Response.Flush()

ppt.Write(Page.Response.OutputStream)

Page.Response.Flush()

Hello,

Were you able to find a solution and correct this problem? We are having it as well and would like to see what you have.

Thanks,

Bob Bachand

Hello Bob,

Both issues are definitely not a problem of Aspose.Slides.
The first issue can be a problem with IIS, Browser, cache or anything else.
The second one is probably wrong asp.net application logic.

Thanks for your reply.

I am interested in only the first issue not the second. I understand that this does not look like an Aspose issue but I was wondering if this particular gentleman had resolved his issue or not.