我已经阅读了很多关于此的问题和博客,但无法解决我的问题。所以我正在上传一个pdf,它的路径存储在这样的数据库中:
E:\laravel12\public\pdf/1577916921.pdf
我正在显示这样的图像:
<iframe src="{{$pdf->data}}" height="500" width="500" style="margin-Top :200px;"></iframe>
我收到此错误:
Not allowed to load local resource: file:///E:/laravel12/public/pdf/1577916921.pdf
如何解决这个问题?
控制器:
if ($req->hasFile('fpdf')) {
$mime = "aaa";
$image = $req->file('fpdf');
$name = time().'.'.$image->getClientOriginalExtension();
$destinationPath = public_path('pdf');
$image->move($destinationPath, $name);
$content = $destinationPath."/".$name;
$up = new Picture();
$up->name = $name;
$up->mime = $mime;
$up->data = $content;
$up->save();
}
心有法竹
杨魅力
撒科打诨
随时随地看视频慕课网APP