Topic: hidden files after upload

Hi,

I have the directory hidden from my webvistiors (chmod 766). However, when I upload a new file, it's given 777, and than the file is accessible from the web.
Is there a way to automatically chmod the file to 766 after it's uploaded?