title: How can I get an asp.net mvc action to consistently deliver a file to the browser?
body: <p>I'm building a little action to take an encrypted PDF file path, decrypt it, and deliver the resulting PDF to the browser.</p>
  
  <p>My code works 100% of the time in Chrome and Firefox, but it works only 50% of the time in IE9.</p>
  
  <p>When I follow the link in IE9, it looks like it opens the Adobe Reader plugin in the browser window, but no file is displayed until I hit refresh.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    [CheckSubscriber]
      public ActionResult file(string path)
      {
          string mappedPath = Server.MapPath(
                                  EncryptDecrypt.Decrypt(path,
                                  EncString));
  
          return base.File(mappedPath, "application/pdf");
  
      }
  </code></pre>
  
  <p>How would I get this to work consistently in IE9? </p>
  
  <p>I'm just thinking out loud here but maybe I am using the wrong mime-type?</p>