简体   繁体   English

how to download a PDF file that is in base64, controller and view en php laravel

[英]how to download a PDF file that is in base64, controller and view en php laravel

I have the PDF stored in the database with base64, but I don't know how to download that file with a button in the view我将 PDF 与 base64 一起存储在数据库中,但我不知道如何使用视图中的按钮下载该文件

<li>
  <body>
    <embed style="height: 100%; width: 100%;" src="chunk_split(data:application/pdf;base64,{{$item->PDF}})" type="application/pdf"></object>
  </body>
</li>

<li>
  <body>
    <embed style="height: 100%; width: 100%;" src="chunk_split(data:application/pdf;base64,{{$item->PDF}})" type="application/pdf"></object>
  </body>
</li>

You could create an endpoint to stream the pdf to client like these stream a pdf file .您可以创建一个端点到 stream 和 pdf 到客户端,例如stream 一个 Z437175BA41912194D094E 文件

Then you can create an然后你可以创建一个

<a href="/endpoint/to/download">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM