To create a downloadable link, make sure you have the uploads directory or a similar directory in the web / directory of your application. Suppose you have PDF files in the web / pdf / directory with the catalog.pdf file, and you want to create a downloadable link for it in Symfony, you can do this as follows
<a href="{{ asset('pdf/') }}catalog.pdf" target="_blank">Download PDF</a>
Assets will directly point to the web folder of your application.
As soon as you click on the link, it will open in a new tab, since I added target = "_ blank"
Channelsaveer hakari
source share