I am using cPanel with apache 2 and php 5.2. I have a file upload script, which currently puts the uploaded files in a directory with 0777 perms and the file itself also has 0777 perms. this is because with other perms, i would be thrown an "Invalid Access" error.
so, what perms should i use so that the files are secure, but can still be accessed when a user wants to download them via my download script?
Are you the SysAdmin of this server?
If you are then I have just answered a very similar question here
Apache DSO file permissions 777
If not you need to question if you're happy to have you site on this server at all.