Search code examples
c#file-type

file type using filecontent


I have filecontent in a byte array, and how to find the type of this file from this byte array content? Like .doc, .docx, .jpg? Thanks


Solution

  • Before getting files in byte array, get FileExtension, and use ID for your byte and extension to find with index.