浏览器展示图片和pdf文件
public function uploadFile(Request $request)
{
$path1 = $request->file("file");// 获取上传的文件
// $path1->store("public/images");
$path1->storeAs("public/file","up.pdf");
}
文件下载
public function download()
{
$pathToFile = "storage/images/up.jpg";
return response()->download($pathToFile);
// return response()->download($pathToFile, $name, $headers);
}