I was working on some PHP code and realized uploads poised a risk to the CMS. Security has never been my strong point when coding but I hope to change that now so please bear with my "noviceness".
Originally I thought of placing a .htaccess file in all upload directories turning off the PHP engine so if some malicious file was uploaded in any of those directories, nothing could happen.
I also came across a tutorial to sanitize using PHP code, which would be the preferred method to proceed? I assume the .htaccess version would be recommended since the other could lead to difficulties depending on hosts?
Originally I thought of placing a .htaccess file in all upload directories turning off the PHP engine so if some malicious file was uploaded in any of those directories, nothing could happen.
I also came across a tutorial to sanitize using PHP code, which would be the preferred method to proceed? I assume the .htaccess version would be recommended since the other could lead to difficulties depending on hosts?






