Prevent execution of uploaded php files?

前端 未结 3 1815
星月不相逢
星月不相逢 2021-01-01 00:13

In my project users are allowed to upload files of any type. I need to ensure security against execution of uploaded files that can parsed by php (*.php, *.html, etc.)

3条回答
  •  感动是毒
    2021-01-01 00:41

    You want the Apache SetHandler directive: http://httpd.apache.org/docs/current/mod/core.html#sethandler

    This lets you force all files in a directory to be processed by a certain handler. So something along the lines of:

    
    SetHandler None
     
    

    should do what you want.

提交回复
热议问题