I have uploaded the pdf link on website and when clicked on link it's not showing pdf file.
view
<div class="entry-content">
<a target="_blank" href=""><p style="font-
size:
18px;color: #468b10;"> </p>
</a>
</div>
controller
public function show($id)
{
$file=Post::find($id);
$content = base64_decode($file->content);
return response($content)->header('Content-Type', $file->file);
}
public function store(Request $request) {
if (request('file'))
{
$file = request('file');
$file_name = time() . $file->getClientOriginalName();
$file->move('uploads/posts', $file_name);
$data['file'] = 'uploads/posts/'.$file_name;
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire