how to identify the extension/type of the file using C#?

前端 未结 5 2035
迷失自我
迷失自我 2021-01-03 00:55

i have a workflow where user is allowed to upload any file and then that file will be read.

Now my question is if user have image file xyz.jpg and he renamed it to

5条回答
  •  死守一世寂寞
    2021-01-03 01:37

    Yes, probably for many file types this is possible, but it would require parsing of the binary contents of the file on a case by case basis.

提交回复
热议问题