title: How to open automatically downloaded Word document in the browser?
body: <p>I use Aspose to generate a Word document. It must be opened in the browser automatically when it comes back from the server.</p>
  
  <p>Here is my code:</p>
  
  <p>Do Ajax call to get the document</p>
  
  <pre><code>    $.ajax({
          url: "Export/StreamWord",
          data: { topicId: CurrentTopic.id },
          success: function (result) {
              //Nothing here. I think that the browser must open the file automatically.
          }
      });
  </code></pre>
  
  <p>Controller .NET MVC 3</p>
  
  <pre><code>    [AcceptVerbs(HttpVerbs.Get)]
      public ActionResult StreamWord(string topicId)
      {
          var stream = new MemoryStream();
          Document doc = exportRepos.GenerateWord(topicId); //Document is a Aspose object
          doc.Save(stream, SaveFormat.Docx);
          stream.WriteTo(Response.OutputStream);
          return File(stream, "application/doc", "test.doc");
      }
  </code></pre>
  
  <p>BUT when I run it from the browser nothing happen.
  Response from the server you can see on the image. Document comes, but it is not been opened.</p>
  
  <p><img src="https://i.stack.imgur.com/4TnH0.png" alt="Headers">
  <img src="https://i.stack.imgur.com/VMAOa.png" alt="Content"></p>
  
  <p>Any suggestions?</p>