Find out the real file type

后端 未结 7 829
遇见更好的自我
遇见更好的自我 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:42

    Get the file headers of the "safe" file types - executables always have their own types of headers, and you can probably detect those. You'd have to be familiar with every format that you intend to accept, however.

提交回复
热议问题