I have got the following problem since the server has safe mode turned on, and directories are being created under different users:
I have had some success with setting the group bit of the upload directory to sticky. PHP can then create directories inside it and write to it.
http://en.wikipedia.org/wiki/Setuid#setuid_and_setgid_on_directories
chmod g+s directory