I have an uploads folder with permissions set to 777
(cannot be changed).
In this, I allow trusted users to upload images.
I want to only allow .jpg .png and .gif
files into this folder.
How can I do this (with .htaccess?)?
EDIT: Someone has said this is not secure. For it to be dangerous, the hacker would still need to get into the server to add files into the directory and execute them, for example using FTP, so it is not that dangerous I think.