3👍
✅
i tried this and it didnt work for me too
dont use ajax or axios
send your request with get-request and in your function return download response:
return response()->download(public_path('uploads/TestWordFile.docx'));
you dont need to send ajax request.
use GET and when you return some response, page wont be refreshed!
this should work for you
1👍
Try using ….
public function downloadFile(Request $request, File $file)
{
return Storage::disk('local')->download($file);
}
Source:stackexchange.com