Streaming In Memory Word Document using OpenXML SDK w/ASP.NET results in “corrupt” document

前端 未结 7 638
北恋
北恋 2021-01-01 15:01

I am unable to stream a word document that I create on the fly down to the browser. I am constantly getting a message from Microsoft Word that the document is corrupt.

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-01 15:23

    I believe your ContentType value is incorrect; that is for Word 97 - 2003 format. Change it to:

    application/vnd.openxmlformats-officedocument.wordprocessingml.document
    

    and see if that fixes the problem.

提交回复
热议问题