title: Open word document in a browser not working --asp.net mvc
body: <p>I Want to open my word and PDF document in a browser window for display. Hwoever, my PDF document is opening fine but the word document fails. Below is my code.</p>
  
  <pre><code>public ActionResult ViewResume(long userid)
          {
              string FileName = getResumeName(userid);
              string path = System.IO.Path.Combine(Server.MapPath("~/Content/files/"), FileName);
              var fileStream = new FileStream(path,
                                       FileMode.Open,
                                       FileAccess.Read
                                     );
              FileInfo info = new FileInfo(FileName);
  
              string extension = info.Extension;
              FileStreamResult fsResult;
  
              if (info.Extension == ".pdf")
                  fsResult = new FileStreamResult(fileStream, "application/pdf");
              else
                  fsResult = new FileStreamResult(fileStream, "application/vnd.ms-word");
  
              return fsResult;
          }
  </code></pre>
  
  <p>When i try to open word document, It download a .exe file for me instead. I am not sure what the issue is. It opens PDF without an issue. Pls any help would be appreciated.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I am suspecting thE MIME type . I am not sure which is the right one for doc .</p>