警告:move_uploaded_file():无法将“文件”移至“文件夹”

时间:2019-04-27 11:18:58

标签: php file-upload file-permissions

我尝试将图像上传到本地主机上的目录。

这是我的php文件中的部分,会导致错误:

if (move_uploaded_file($tmp_name, "/Users/sandro/Documents/bildgalerie/uploads")) {
    echo "The file " . basename($filename) . " has been uploaded";
} else {
    echo "error";
}

如果我加载页面,则会得到以下信息:

Warning: move_uploaded_file(): Unable to move '/private/var/folders/np/sln14hvn3tsbzc4kpjjtp17c0000gn/T/phppJbFJK' to '/Users/sandro/Documents/bildgalerie/uploads' in /Users/sandro/Documents/bildgalerie/control/upload.php on line 31

0 个答案:

没有答案