Why are .docx files being corrupted when downloading from an ASP.NET page?

I also ran into this problem and actually found the answer here:

It turns out that the docx format needs to have Response.End() right after the Response.BinaryWrite.

Leave a Comment