How do you check a file type when there is no extension in c#

后端 未结 2 1209
星月不相逢
星月不相逢 2020-12-11 09:58

How do you check a file type when there is no extension in c#

For instance, I have files with no extension, that are either .mp4 or .flv format (just no extension).

相关标签:
2条回答
  • 2020-12-11 10:53

    I had played this utility (TrID - File Identifier) and seems quite accurate. File type defination package (TrIDDefs) is also up to date.

    And Here is a list of file type signature table if you interest. The list is continuing work-in-process.

    0 讨论(0)
  • 2020-12-11 10:56

    I've heard of reading the first few bytes of a file's contents and making an educated guess at the file's format. This link seems promising:

    Using .NET, how can you find the mime type of a file based on the file signature not the extension

    0 讨论(0)
提交回复
热议问题