diff --git a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php index bc1d9eb5..51ef3428 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/DownloadBookingDocumentLogic.php @@ -51,17 +51,10 @@ class DownloadBookingDocumentLogic exit("Error creating ZIP file"); }; - if (file_exists($attachment)) { + Storage::download('documents/collections/' . $zip_file); - header('Content-Type: application/zip'); - header('Content-disposition: attachment; filename='.$request->input('type').'.zip'); - header('Content-Length: ' . filesize($attachment)); - readfile($attachment); - } else { - exit("Could not find Zip file to download"); - } + File::delete($attachment); - unlink($attachment); } }