title: How to convert byte array into it's appropriate file format in ASP.NET MVC
body: <p>I have a system that's supposed to convert a byte array (not knowing whether its pdf, txt, or doc) provided to me into a downloadable file. Now usually in ASP.NET MVC I would do it like this.</p>
  
  <pre><code>return File(labTestResult.File, "application/pdf");
  </code></pre>
  
  <p>That's easy because I know what the filetype is. Now that the filetype could be anything, is there a way to download the file to its appropriate format?</p>