title: open docx in asp.net
body: <p>I have a requirement of opening the docx file in the browser. Tried with the code below. But error occurs that the file is corrupt. Is the content type correct, tried with thecontent type application/msword also.</p>
  
  <p><strong>Response.AddHeader("content-disposition", "inline;filename=" + DisplayFileName);
  Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";//getContentType(filename);
  Response.WriteFile(fullpath);
  Response.End();
  Response.Flush();</strong></p>
  
  <p>The code works for all other file types when the appropriate content type is given. The problem is only with docx.</p>