From 1d6df82c1c7311957f9ee0c6d8ad19ee974fd5e1 Mon Sep 17 00:00:00 2001 From: Jeppe B <2jepp9350@gmail.com> Date: Mon, 1 Jun 2026 23:02:01 +0200 Subject: [PATCH] Delete local wash certificate PDFs after upload --- services/nginx/app/modules/washcertificates/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/nginx/app/modules/washcertificates/index.php b/services/nginx/app/modules/washcertificates/index.php index 9563d96c..eb6e53fb 100644 --- a/services/nginx/app/modules/washcertificates/index.php +++ b/services/nginx/app/modules/washcertificates/index.php @@ -100,7 +100,7 @@ if ($wash_certificate_store->washCertificateExists($_GET['bookingId'])) { $success = $wash_certificate_store->uploadFile("wash_certificate_" . $_GET['bookingId'] . ".pdf", dirname(__FILE__) . "/output/certificates/wash_certificate_" . $_GET['bookingId'] . ".pdf"); // If the certificate was uploaded successfully, delete the local copy if ($success) { - //unlink(dirname(__FILE__) . "/output/certificates/wash_certificate_" . $_GET['bookingId'] . ".pdf"); + unlink(dirname(__FILE__) . "/output/certificates/wash_certificate_" . $_GET['bookingId'] . ".pdf"); // Return the certificate url echo $wash_certificate_store->getWashCertificateDownload($_GET['bookingId']); exit; @@ -127,7 +127,7 @@ $generatedCertificatePath = "output/certificates/wash_certificate_" . $_GET['boo $wash_certificate_store->uploadFile($generatedCertificateName, dirname(__FILE__) . '/' . $generatedCertificatePath); // Delete the local copy of the certificate -//unlink(dirname(__FILE__) . '/' . $generatedCertificatePath); +unlink(dirname(__FILE__) . '/' . $generatedCertificatePath); // Set the status of the booking to completed $booking = new bookings_o(); @@ -140,4 +140,4 @@ $booking->washCertificateStatus->set('completed'); // Return the generated certificate object download URL echo $wash_certificate_store->getWashCertificateDownload($_GET['bookingId']); // Exit the script -exit; \ No newline at end of file +exit;