My code is like this :
<a href="javascript:;" onclick="showAjaxPdf('{{ $row->file_path }}');"><i class="fa fa-file-pdf-o"></i></a>
My javascript code is like this :
function showAjaxPdf(file_path){
//example : file_path = assets/images/myfile.pdf
$.post("news/test", { file_path: file_path } );
}
My function test in controller :
public function postTest(Request $request)
{
$file_path = $request->input('file_path');
return response()->download($file_path);
}
When I click on the pdf icon, no response
I wish, when click on the pdf icon, appear like this:
Thank you
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1OYhuDo
via IFTTT
Aucun commentaire:
Enregistrer un commentaire