Find out the real file type

后端 未结 7 854
遇见更好的自我
遇见更好的自我 2020-12-29 15:02

I am working on an ASP web page that handles file uploads. Only certain types of files are allowed to be uploaded, like .XLS, .XML, .CSV, .TXT, .PDF, .PPT, etc.

I

7条回答
  •  一个人的身影
    2020-12-29 15:24

    One way would be to check for certain signatures or magic numbers in the files. This page has a handy list of known file signatures and seems quite up to date:

    http://www.garykessler.net/library/file_sigs.html

提交回复
热议问题