You don't need to submit this via a form, simply use an anchor tag and put the link in the href="" attribute.. If you dump out the $file is it giving you the correct file path?
Nov 10, 2021
5
Level 3
I am trying to update my cv on my portfolio website. After updating the route still downloads the old one
I am trying to update my cv on my portfolio website. After updating the route still downloads the old one. I would like to note that when I am introducing the url link manually on the search bar of the browser everything works fine. I hope I have explaied clea the problem. Here is the code
Route::get('/download/cv', function(){
$file = storage_path()."/cv/resumeAndrei.pdf";
return response()->download($file,'resumeAndrei.pdf');
})->name('andrei.cv');
<form method="get" action="{{route('andrei.cv')}}">
<button type="submit">
<div id="button-download" style="margin-top: 50px">
<div id="overflow"></div>
<div style="color: white; margin-left: 30px; ">DOWNLOAD CV</div>
<div id="arrow"><img src="{{asset('assets/icons/arrow.png')}}" alt=""></div>
</div>
</button>
</form>
Level 102
Maybe browser cache
return response()->download($file,'resumeAndrei.pdf');
})->name('andrei.cv.pdf?v=2');
Please or to participate in this conversation.