title: ASP.Net Core Content-Disposition attachment/inline
body: <p>I am returning a file from a WebAPI controller. The Content-Disposition header value is automatically set to "attachment". For example:</p>
  
  <blockquote>
    <p>Disposition: attachment; filename="30956.pdf"; filename*=UTF-8''30956.pdf</p>
  </blockquote>
  
  <p>When it is set to attachment the browser will ask to save file instead of opening it. I would like it to open it.</p>
  
  <p>How can I set it to "inline" instead of "attachment"?</p>
  
  <p>I am sending the file using this method:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public IActionResult GetDocument(int id)
  {
      var filename = $"folder/{id}.pdf";
      var fileContentResult = new FileContentResult(File.ReadAllBytes(filename), "application/pdf")
      {
          FileDownloadName = $"{id}.pdf"
      };
      // I need to delete file after me
      System.IO.File.Delete(filename);
  
      return fileContentResult;
  }
  </code></pre>