title: ASP.NET MVC Determine mime type by file/file path
body: <p>I am using ASP.NET MVC 3.
  The application is targeting .net 4.0.</p>
  
  <p>I was trying to pass a virtual path as argument to my controller's action and return the file without reviewing the actual physical path on the server and providing basic Authorization. Unfortunately I was unable to find a suitable overload for File method to generate the appropriate ActionResult. I am stuck at determining mime type for the file.</p>
  
  <p>I've found a couple of solutions for determining mime-types by file name, but none of them are satisfying me. I was wondering how does IIS determines the mime type when you are requesting a file on the server? Is it possible to somehow pass to IIS the responsibility for determining the mime type for the response</p>