What is the most secure method for uploading a file?

前端 未结 3 783
星月不相逢
星月不相逢 2020-11-30 17:39

The company I work for has recently been hit with many header injection and file upload exploits on the sites we host and while we have fixed the problem with respect to hea

3条回答
  •  一向
    一向 (楼主)
    2020-11-30 18:22

    The best solution, IMHO, is to put the directory containing the uploaded files outside of the "web" environment and use a script to make them downloadable. In this way, even if somebody uploads a script it can not be executed by calling it from the browser and you don't have to check the type of the uploaded file.

提交回复
热议问题