title: How to get the file extension or content type from file byte array. in C#
body: <p>How to get the file extension or content type from file byte array. in C#</p>
  
  <p>we have a problem in our production environment that, after last production upgrade PNG files uploaded previously were saved as JPG file extension. so when i read that file i cannot set mimetype as PNG, since currently it takes from path.getextension, but this is wrong- my actual file is PNG type. this is causing issues in rendering images.</p>
  
  <p>How to get the file extension or content type from file byte array. in C#</p>