所以我想使用 LAMP 将图像从 Windows 保存到我的 linux 文件夹中,我创建了一个用于将图像保存到 Windows 上的文件夹中的 php,但是当我将文件上传到 linux 时,我测试不工作,这是我使用的 php红豆框架。
我用灯做的服务器,当我选择要插入的图像时,我使用谷歌浏览器访问它保存了路由,但它没有将图像保存在 linux 中的服务器文件夹中
其他事情我通过谷歌浏览器打开服务器,它的工作是 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');
}
?>