I am trying to show an excel file, but this one instead of showing what it does is download it at once.
Thus I try to show the file
public function ari(){
$file = storage_path() . '\app\excel\formulario ORIGINAL ARI.xlsx';
$headers = ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
return response()->file($file, $headers);
}
However if I deal with a file pdf
I have no problem.
public function cardAval(){
$file = storage_path() . '\app\pdf\carta-aval.pdf';
$headers = ['Content-Type' => 'application/pdf'];
return response()->file($file, $headers);
}
So the browser shows me the file and does not force the download as in the file excel
, What am I wrong?