title: How can I open a pdf file directly in my browser?
body: <p>I would like to view a <code>PDF</code> file directly in my browser. I know this question is already asked but I haven't found a solution that works for me.</p>
  
  <p>Here is my action's controller code so far:</p>
  
  <pre><code>public ActionResult GetPdf(string fileName)
  {
      string filePath = "~/Content/files/" + fileName;
      return File(filePath, "application/pdf", fileName);
  }
  </code></pre>
  
  <p>Here is my view:</p>
  
  <pre><code>@{
     doc = "Mode_d'emploi.pdf";
  } 
  
  &lt;p&gt;@Html.ActionLink(UserResource.DocumentationLink, "GetPdf", "General", new { fileName = doc }, null)&lt;/p&gt;
  </code></pre>
  
  <p>When I mouse hover the link here is the link:</p>
  
  <p><img src="https://i.stack.imgur.com/dRTPi.png" alt="enter image description here"></p>
  
  <p>The problem with my code is that the <code>pdf</code> file is not viewed in the browser but I get a message asking me if I wand to open or save the file.</p>
  
  <p><img src="https://i.stack.imgur.com/u3T5w.png" alt="enter image description here"></p>
  
  <p>I know it is possible and my browser support it because I already test it with another website allowing me to view <code>pdf</code> directly in my browser.</p>
  
  <p>For example, here is the link when I mouse hover a link (on another website):</p>
  
  <p><img src="https://i.stack.imgur.com/oZq60.png" alt="enter image description here"></p>
  
  <p>As you can see there is a difference in the generated link. I don't know if this is useful.</p>
  
  <p>Any idea how can I view my <code>pdf</code> directly in the browser?</p>