I am looking for a way to return the docx file as array of byte without saving the file to server disk.
I could return the output stream from Api assembly then write-it to the Response object as follows:
using (DocBuilder builder = new DocBuilder(strTemplateFilePath))
objStream = builder.Build(strDataPath, nsPrefix, ns, strOutputDocument, Thread.CurrentThread.CurrentUICulture, true);
Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
Response.AddHeader("content-disposition", "attachment; filename=client.docx");
Unfortunately, the output docx file contains the famous corrupted file popup when opening-it which is a bug in office 2007. Is there a method that returns the correct array of byte from the word package?
Thank you for your cooperation.