download billing documents

This commit is contained in:
omair saleh
2022-03-02 04:02:28 +08:00
parent 917fc249ca
commit 5634a99643
@@ -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);
}
}