所以我想使用LAMP将Windows中的图像保存到我的linux文件夹中,我创建了一个php将图像保存到Windows上的文件夹中,效果很好,但是当我将文件上传到linux时,我测试不起作用,这是php im使用redbean框架。
我用灯做的服务器,当我选择要插入的图像时,我使用google chrome访问它,它保存了路由,但没有将图像保存在Linux中服务器的文件夹中
我通过google chrome打开服务器的其他方法是可行的,php将文本保存为img url,但不将图像保存到linux文件夹中。
代码:
<?php
require('conexion.php');
$b=R::dispense('blog');
$fileName=$_FILES['imagen']['name'];
$file=$_FILES['imagen']['tmp_name'];
if (is_uploaded_file($file))
{
echo $fileName;
$destino="/var/www/html/blog/imgsubidas/".$fileName;
move_uploaded_file($file,$destino);
$b->titulo=$_POST["titulo"];
$b->imagen=$destino;
$b->contenido=$_POST["content"];
$b->fecha=date("d/m/Y");
R::store($b);
header('location:dashboard.php');
}
?>