PHP Function Rename Permission denied

后端 未结 3 375
予麋鹿
予麋鹿 2021-01-05 03:34

In server, script create new folder, set chmod to 0777, but then it tryes to move files to that folder i get error: Permission denied.

mkdir(\"../\".$new_1,          


        
相关标签:
3条回答
  • 2021-01-05 03:52

    you'll need to have read and write permissions in the source folder, too.

    only having permissions for the target-folder isn't enough as the file is removed from it's source.

    0 讨论(0)
  • 2021-01-05 03:52

    You should also have permission to change the file "files/".$failai[$i].".jpg". I would guess that that is going wrong

    0 讨论(0)
  • 2021-01-05 04:01

    Do you have the write access to the file? If not, make sure you chmod the file to 777 or at least to 644.

    Also, check the existence of the file by giving a file_exists() on the file name before you rename. :)

    Also, after moving file, you might need to set the permissions using chmod() to make it available for renaming. You can do it this way:

    <?php
        chmod($uploadedFile, 0755);
    ?>
    
    0 讨论(0)
提交回复
热议问题