OunknownO OunknownO - 1 year ago 60
PHP Question

When trying file download it shows error route not found

This is in my blade file

{!! Html::link(storage_path().'/documents/'.$file->name, $file->name) !!}

This is controller

public function download($file_name){
$file_path = storage_path('documents').'/'.$file_name;
return response()->download($file_path);



Answer Source

You want to add your exact route to your HTML link instead of the path of the file:

{!! Html::link('/documents/'.$file->name, $file->name) !!}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download