dimanche 31 mars 2019

How to say browser to start download file?

Using client side I do POST request to Laravel to get back file to browser:

$headers = [
             'Content-Type' => 'application/vnd.ms-excel',
             'Content-Disposition' => "attachment; filename='Report.xls'"
        ];

        return response()->download(storage_path('app/'.$path.$filename), $filename, $headers);

It returns me binary file in response:

enter image description here

Response headers are:

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire