move_uploaded_file(...):无法打开流:权限被拒绝...使用Mac OS X Mountain Lion

So basically I have your classic 'move_uploaded_file' statement:

move_uploaded_file($_FILES['image']['tmp_name'], 'files/' . $_FILES['image']['name']);

But I am getting this on my OS X Mountain Lion:

move_uploaded_file(...): failed to open stream: Permission denied in... 

How can I change the permissions so I can move it?

in MAC OS X's terminal ,use this commande :

  CHMOD 775 yourFilesPath

775:Standard file sharing mode for a group.

First thing to note down since you are using xamp server which have the Application folder in Root

/Applications/XAMPP/xamppfiles/htdocs/emp/files/admin_assets/addsdassets

so for uploading the image file you have to provide the target directory which should be present in the Root try with the same directory in which application is running

And then locate the xamp server location by clicking on show original on the mac after right click and then change the permission

for the images folder and the php file, by going to the file > Right click > Get info > and then change all the permissions to read&write as the following picture.

enter image description here