title: how to open Word Document in browser?
body: <p>I want to open binary Word Document file in browser, not from physical path. With the given below code I can open PDF files in browser, but not other files. </p>
  
  <p>CODE: </p>
  
  <pre><code>byte[] obFile = null;
  obFile = (byte[])fds.Tables[0].Rows[0]["File"]; 
  String aFileName = "abc"; 
  Response.Expires = 0; 
  Response.ClearContent(); 
  Response.Buffer = true; 
  Response.BufferOutput = true; 
  Response.ContentType = "application/msword;name=abc.docx"; 
  Response.AddHeader("content-transfer-encoding", "binary"); 
  Response.AddHeader("content-length", obFile.Length.ToString()); 
  Response.AddHeader("Content-Disposition", "inline; filename=abc.docx"; 
  Response.CacheControl = "public"; 
  Response.ContentEncoding = System.Text.Encoding.GetEncoding(1251); 
  Response.OutputStream.Write(obFile, 0, obFile.Length); 
  Response.End(); 
  </code></pre>