use Illuminate\Support\Facades\Storage;


//建立目录
Storage::disk('public')->makeDirectory(date('Y-m'));

//存文件 public为config/filesystems.php存的配置
$bool = Storage::disk('public')->put($filename, file_get_contents($realPath));

 

$fileStr = Storage::disk('public')->get($fileName);//获取文件内容
//获取目录文件,两个返回值有差别,第一个带public
$files = Storage::allFiles('public');
$files = Storage::disk('public')->allFiles();

 

 

可参考:https://d.laravel-china.org/docs/5.5/filesystem

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2021-06-03
  • 2021-07-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
相关资源
相似解决方案