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

Free Support Forum - aspose.com

Example of sending doc to client not working

I am trying to create a very basic word document (as a tester) and am running into issues while trying to save the document and send it to the browser (so that it won’t save it on the server). However, when I copy the example into my code it throws an error.


Here’s the code:

doc.Save(Response, “Report Out.doc”, ContentDisposition.Inline, null);

The error is “cannot resolve method” and it looks like it should start with a string or System.IO.Stream.

I am running the latest version of Aspose.Words (10.4.00) and the application is based on .NET 4.0. When I downloaded Aspose.Total DLL only, I could only find the Aspose.Words dll in the .NET 3.5 and earlier folders.

Any help would be greatly appreciated!

Thanks,
Andrew
alexey.noskov:

Hi

Thank you for additional information. Most likely you are using Aspose.Words .NET 3.5 Client Profile that is why this overload of Save method is not available .NET 3.5 Client Profile excludes System.Web and therefore HttpResponse is not available. This is entirely by design. If you need to use Aspose.Words in ASP.NET application, I would recommend you use .NET 2.0 Client Profile and the following overload of Save method:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.document.save_overload_6.html

Best regards,

Even though that doesn't make too much sense, that works. Thank you!