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



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2I9d4kz
via IFTTT

Aucun commentaire:

Enregistrer un commentaire