you can use [man]chmod/man to do it... IF the server allows you. If the server doesn't allow you, you will have to use 777 permissions.
Or you could set your server up so that php runs as the user currently running in the site (i.e. each virtualhost defines the UserGroup setting to be their username) so that php runs as that ftp user and can rwx any directory they immediately control.
I hope you don't think that not having 777 permissions on your server will protect you. That's not always true. It would be better if you chose to check the files coming in for valid content and denied access to that folder by direct browsing OR disabled php/asp/cgi/python/perl or any other language or force the files to download so that they can't be maliciously run.