看不到上传的图片

Can't see image that was uploaded

我已将 xampp 服务器移至 raspbian 以上传图片。我可以通过浏览器访问服务器、文件夹,并且可以看到该图像已在数据库中注册,但不幸的是该文件夹中没有图像。

如果您需要更具体的信息,请告诉我。

我的 phone 应用程序:https://gist.github.com/DoIReallyNeedIt/a068c69958f269ad1d1a373d9ec8bcdb 连接到服务器:

<?php

$user_name = "root";
$user_pass = "root";
$host_name = "localhost";
$db_name = "mydb";

$con = mysqli_connect ($host_name, $user_name, $user_pass, $db_name);


if ($con)

{

$image = $_POST["image"];
$name =date('Y').date('m').date('d'). "_" . date('H'). date('i'). "_". $_POST["name2"]."_".$_POST["name1"];
$sql = "insert into imageinfo(name) values ('$name')";
$upload_path = "uploads/$name.jpg";


if(mysqli_query($con,$sql)){
    file_put_contents ($upload_path, base64_decode($image));
    echo json_encode (array ('response'=>'Nuotrauka buvo sėkmingai įkelta'));

}

else {
    echo json_encode (array ('response'=>'Nuotraukos įkelti nepayvko'));
}
}
mysqli_close($con);
?>  

找到问题了。出于某种原因,chmod 没有为文件夹保存