Aspose.net not sending doc to browser with correct filename in IE9

Hi,

I’m trying to upgrade a legacy app from v6.5 to v17.3 (I’ve tried some earlier versions too, v11.11, and 15.9)

On IE9 I’m having issues with:

Doc.Save(Response, "Report.doc", ContentDisposition.Inline, new DocSaveOptions { SaveFormat = SaveFormat.Doc });

When trying to send to the browser it asks if I want to save MyPage_aspx instead of Report.doc.

Saving the same document to the filesystem works and the v6.5 code (below) also works.

resultDoc.Save("Report.doc", SaveFormat.Doc, SaveType.OpenInWord, Response);

I’ve tried sending to Response.OutputStream and also sending to a MemoryStream which is then copied to Response.OutputStream (With Response headers and content types set) but these have the same problem.

Any help greatly appreciated,

Thanks

Hi there,

Thanks for your inquiry. Please use ContentDisposition.Attachment instead of ContentDisposition.Inline.

Using ContentDisposition.Attachment option sends the document to the browser and present an option to save the document to disk or open in the application associated with the document’s extension.

If you still face problem, please create a simple web application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing. Please also share your input document. We will investigate the issue on our side and provide you more information.

doc.Save(Response, "Report.doc", ContentDisposition.Attachment, new DocSaveOptions { SaveFormat = SaveFormat.Doc });