I have a PHP upload script and am trying to make it so that the uploaded files can be editable and readable by all users of my website (i.e., set the file permissions of the uploaded-file to chmod 777).  The directory to which the files are uploaded to has the correct permissions. However, the uploaded files do not.  Because new files will be constantly uploaded, I need to have some sort of code built in to the upload process that sets/changes the file permissions of the uploaded file upon uploading.
Any thoughts?