title: Download File from FileSystem no matter the file type in MVC
body: <p>I need to download a file from my controller method - that can be of any file type.  Everything I can find in Stackoverflow is either downloading from the database or the file type is known.  From the code I have found so far this is my code:</p>
  
  <pre><code>public FilePathResult ViewAttachment(string filePath, string fileName)
  {
       byte[] fileData = System.IO.File.ReadAllBytes(filePath);
       string contentType = MimeMapping.GetMimeMapping(filePath);
  
       return File(fileData, contentType, filePath);
  }
  </code></pre>
  
  <p>Unfortunately this is giving me an error on the return file line saying:</p>
  
  <blockquote>
    <p>Cannot explicitly convert type 'System.Web.Mvc.FileConentResult' to
    'System.Web.Mvc.FilePathResult'</p>
  </blockquote>