title: How to get the File's Content Type in asp.net mvc 5
body: <p>I know the file's name, that is saved on server, I want to get the <code>contentType</code> of that file that is saved on server, what I want is something like this: </p>
  
  <pre><code>string loc = Server.MapPath("~/Content/Images/document.*");
  </code></pre>
  
  <p>But the above code is not working and the error says :</p>
  
  <blockquote>
    <p>Illegal character is specified i.e.(*)</p>
  </blockquote>
  
  <p>My question is, how to get the extension and the content type of the file name that I know and is saved on server?</p>