Reputation: 33
Here is the code:
<a download="MyPdf" href="{{ storage('app/public/file.pdf') }}" title="MyPdf">Download</a>
The file.pdf are in the folder storage/app/public
Upvotes: 1
Views: 9749
Reputation: 1806
add url like
Route::get('get/file', function(){
return Storage::download('path to file');
})
now hit the url and you will download the file
Upvotes: 0
Reputation: 513
First you need to create a symbolic link
php artisan storage:link
That will create a symbolic link to /storage/app/public
After you need use Storage::url()
;
Example:
<a download="MyPdf" href="{{ Storage::url('file.pdf') }}" title="MyPdf">Download</a>
With this you will download what is in the /storage/app/public/file.pdf
folder
Upvotes: 2