I'm guessing you're having the problem because WinSCP removes existing files before uploading new ones - which should never happen unless you do not have the 'write' permissions on the old file, in which case deleting and replacing is the only way for WinSCP to upload your files.
When creating a new file on Linux, the creator's primary group will be the file's group1, and the permissions will be calculated2 using (0666 & ~umask). The owner can modify permissions, but can only change the file's group into a group he himself belongs to.
In the case of a website, I usually set the setgid bit on the directories, so that all files I create inside become owned by that group:
sudo chown -R :www-data public_html/
find public_html/ -type d -exec chmod g+s {} \;
If the server's filesystem has ACLs enabled, you could also specify default permissions for the group:
setfacl -Rdm g::rX public_html
Or you could skip the "setgid" and "chgrp" steps, and just assign default permissions to the group you want:
setfacl -Rm g:www-data:rX public_html
setfacl -Rdm g:www-data-rX public_html
(The commands with -d set default permissions.)
- Unless the directory has the setgid bit, which makes newly created files inherit the directory's group.
- Can be influenced using default ACLs on the directory.