diff --git a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php index 90df4f86..8d7dafde 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php @@ -23,7 +23,7 @@ class DownloadBookingDocumentLogic /** * @param Request $request - * @return void + * @return \Symfony\Component\HttpFoundation\BinaryFileResponse * @throws MalformedRequestException */ public function execute(Request $request) @@ -48,10 +48,10 @@ class DownloadBookingDocumentLogic } $zip->close(); - - header('Content-Type: application/zip'); - header('Content-Length: ' . filesize($attachment)); - readfile($attachment); + return response()->download($attachment)->deleteFileAfterSend(true); +// header('Content-Type: application/zip'); +// header('Content-Length: ' . filesize($attachment)); +// readfile($attachment); // unlink($attachment); }