title: Why does the FindMimeFromData function from Urlmon.dll return MIME type “application/octet-stream” for many file types?
body: <p>Why does the FindMimeFromData function from Urlmon.dll return MIME type “application/octet-stream” for many file types, whereas checking MIME type by file extension (I.e. against windows registry) returns a more precise type?</p>
  
  <p>For example, mp3 is an “application/octet-stream” instead of “audio/mp3”.</p>
  
  <p>Basically, I want to verify an uploaded file with incorrect extension. This method seems to work for many image files, xml, etc.</p>
  
  <p>The question is similar to <a href="https://stackoverflow.com/questions/58510/using-net-how-can-you-find-the-mime-type-of-a-file-based-on-the-file-signature">this one</a>, but the provided solution is not suited for validating uploaded files, because of different/ambiguous MIME types returned. </p>