doujumiao5024
2013-08-22 02:33
浏览 69
已采纳

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?

图片转代码服务由CSDN问答提供 功能建议

所以基本上我有你的经典'move_uploaded_file'语句:

  move_uploaded_file($ _ FILES ['image'] ['tmp_name'],'files /'。$ _FILES ['image'] ['name']); 
   
 
 < 但是我在我的OS X Mountain Lion上得到了这个: 
 
 
  move_uploaded_file(...):无法打开流:权限被拒绝... 
   
 
 

如何更改权限以便我可以移动它?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • doumiang2297 2013-08-22 02:35
    已采纳

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

      CHMOD 775 yourFilesPath
    

    775:Standard file sharing mode for a group.

    点赞 打赏 评论
  • doupai8533 2016-08-28 09:54

    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

    点赞 打赏 评论

相关推荐 更多相似问题