What is the correct way to allow users to upload images to a site? I'm using mod\_php so everything is done by apache, not the domains user.

Right now I just chmod 777 the images folder and hope for the best :)

I've been looking at adding an .htaccess file to prevent PHP from running in that folder.