Hi,
I have Word 2010 file on HDD.
I need download file as attachment from ASPX application and I cannot save doc to the file (hosting & permissions). Stream I am sending by this code:
Response.ContentType = "application/msword"
Response.AddHeader("Content-Disposition", "attachment;filename=Licence.docx")
Response.BinaryWrite(s.GetBuffer())
After I opened it (doc.LoadFromFile(filename, FileFormat.Docx)) I can save it to disc (doc.SaveToFile (filename2, FileFormat.Docx)) and everything is ok.
When I didn't save document to disc, but to the stream (doc.SaveToStream(stream, FileFormat.Docx)), document is corrupted
Do you have some ideas what can be wrong?
Martin