当我想移动一个文件laravel给了我一个错误,我不明白为什么。Laravel 5.2 - 文件未找到(虽然它在那里);
这是错误我收到
local.ERROR: exception 'League\Flysystem\FileNotFoundException' with message 'File not found at path: Ad_Pictures/waitinglist/6f6232707e65c7803f7af248a07cb8cesony-z5-familytn videos ad.jpg'
然而,当我看到在服务器上它天内文件是存在的(这是第4一个)
这里是我的我用来移动文件的代码
$newAd = DB::table('ads')->orderBy('created_at', 'desc')->first();
$Ad = Ad::find($newAd->id);
$oldDestination_path = "Ad_Pictures/waitinglist/";
$newDestination_path = "Ad_Pictures/".$newAd->id."/";
if(!is_dir($newDestination_path))
{
mkdir($newDestination_path);
}
Storage::move($oldDestination_path.'/'.$file, $newDestination_path.'/'.$file);
他使新目录没有问题,他只是不移动文件。
屏幕截图被裁剪 - 显示的是哪个目录 - 是Ad_Pictures/waitinglist还是/ Ad_Pictures /? – herrjeh42
并且:你是否对文件名中没有空格的文件尝试了相同的代码?你永远不会知道...... ;-) – herrjeh42
尝试转储dedtination和名称变量,我的东西laravel是在存储文件夹中的lookibg,而你在公共foldef文件 –