PHP / OS X:使用move_uploaded_file()创建的新文件的权限

My environment is Apache on OS X with PHP.

My script creates file with move_uploaded_file() in the folder /www/mysite/uploads/ but the permissions are set as such:

-rw-r--r--  1 _www  wheel   857K 23 Jul 23:10 temp.png

What I want is for the permissions to be set to:

-rw-rw----  1 _www  admin   857K 23 Jul 23:10 temp.png

How do I do that?

You can use chmod() after moving the file.

move_uploaded_file($filename , $destination);
chmod($destination, 0644);

http://php.net/chmod