Php Laravel读取存储器中的文件
我已将图像保存在存储器中的文件中。我想在控制器中使用exec命令将文件保存到数组中,然后将数组传递到刀片服务器。有什么办法吗Php Laravel读取存储器中的文件,php,laravel,laravel-blade,Php,Laravel,Laravel Blade,我已将图像保存在存储器中的文件中。我想在控制器中使用exec命令将文件保存到数组中,然后将数组传递到刀片服务器。有什么办法吗 $images= []; // $filesInFolder = \File::files('images'); getting files from the folder $files = file_get_contents( 'filename' ); // replace here the filename with you full path of the fi
$images= [];
// $filesInFolder = \File::files('images'); getting files from the folder
$files = file_get_contents( 'filename' ); // replace here the filename with you full path of the file
foreach($files as $path)
{
$images[] = pathinfo($path);
}
然后您可以将图像/文件传递到刀片中。很抱歉,我误解了您从文件中读取文件名的要求。我不确定你是否希望这样我想把文件保存到一个数组中,你做了什么事情没有?我们能看看你的密码吗?为什么是exec?请查看并确保您采取了相应的措施。这个想法是告诉我们你想做什么,展示你已经尝试了什么,展示你得到了什么结果。