我已经完成chmod -R 777
了根文件夹,但我仍然无法成功
上传(因此,写入)到上传的文件夹!
我是否还必须更改 php.ini 文件?
//$target_path = "http://localhost/photoServerProject/uploaded";
$target_path = "/photoServerProject/uploaded";
$fname = $_FILES["file"]["name"];
$upload_location = $target_path.'/'.$fname;
move_uploaded_file($_FILES["file"]["tmp_name"], $upload_location);
echo 'Moving file: ' . $fname . '</br></br>to: ' . $upload_location;
//echo "<img src=$upload_location>";
if(is_writeable($upload_location)){
echo '</br></br>Location <strong>is</strong> writeable ';
} else {
echo '</br></br>Location <strong>is NOT</strong> writeable ';
}
输出:
移动文件:camera.jpeg
到:/photoServerProject/uploaded/camera.jpeg
位置不可写