Well, the required setting of the file creation mask (umask) will depend on:
a) the uid that your web server process runs as
b) the uid that you use to upload files
and the respective membership groups.
In the simplest sense the unix permissions look like this (in binary)
xxx xxx xxx
*- execute bit for other users
*-- write bit for other users
*--- read bit for other users
*-execute bit for the group
*-- write bit for the group
*--- read bit for the group
*- execute bit for the owner
*-- write bit for the owner
*--- read bit for the owner
So, a permission of 111 101 100 would mean that the file owner has permission to read, write and execute the file, members of the same group (not the owners group, but the file's group) have permission to read and execute, while other users just have read permission. This would normally be expressed in octal as 754
The umask is used to control what the permissions of newly created files (and directories) are. It is expressed in octal, and is usually exclusive orred with 777 to determine the file permissions. However, files are not usually given the execute bit, so therefore consider that files (not directories) are logically anded with 111
i.e: File Test:
777 xor (022 && 111) == 644
111 111 111
xor 001 011 011
= 111 100 100
i.e: Directory Test:
777 xor 022 == 755
111 111 111
xor 000 010 010
= 111 101 101
Here's a history of what I did in unix to reproduce this test
robl@ws:/tmp$ umask
0022
robl@ws:/tmp$ touch test.1
robl@ws:/tmp$ ls -l test.1
-rw-r--r-- 1 robl robl 0 2007-06-13 20:02 test.1
robl@ws:/tmp$ mkdir test.2
robl@ws:/tmp$ ls -ld test.2
drwxr-xr-x 2 robl robl 4096 2007-06-13 20:02 test.2