From 88cd33e2f0e7f1e7944b348e9c85a2d1d2db7e10 Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Tue, 27 Jan 2026 10:09:25 +0530 Subject: [PATCH] FIX_due filepath missing --- app/Controllers/ClientController.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 7289c89e..9563cbe2 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -1134,6 +1134,7 @@ class ClientController extends AdminController $data = $this->request->getPost(); $sanitized_data = sanitizeInputArrayAdvanced($data); $form_type = $sanitized_data['form_type'] ?? null; + $uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents'; unset($data['file_name']); @@ -1188,6 +1189,7 @@ class ClientController extends AdminController $data = $this->request->getPost(); $sanitized_data = sanitizeInputArrayAdvanced($data); $form_type = $sanitized_data['form_type'] ?? null; + $uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents'; unset($sanitized_data['file_name']); @@ -1279,6 +1281,7 @@ class ClientController extends AdminController $file = $this->request->getFile('file_name'); + $uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents'; $fileName = file_Upload($file, $uploadFilePath); if (!empty($fileName)) { @@ -1286,10 +1289,10 @@ class ClientController extends AdminController } $sanitized_data['created_by'] = get_session_userid(); - $uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents'; - $File = file_Upload($uploadedFile, $uploadFilePath); - $this->myLogger->logme('info', 'Result of file_Upload: ' . $File); + + + $this->myLogger->logme('info', 'Result of file_Upload: ' . $fileName); unset($data['file_name']); $insertID = $this->clientKYCDocsModel->insert($sanitized_data); @@ -1297,7 +1300,7 @@ class ClientController extends AdminController if ($insertID) { $html = $this->generateKycSingleTable($sanitized_data['client_id']); $dropdown = $this->fetch_dropdown($sanitized_data['client_id']); - return $this->respond(['status' => true, 'code' => 200, 'file_name' => $File, 'html' => $html,'dropdown'=>$dropdown], 200); + return $this->respond(['status' => true, 'code' => 200, 'file_name' => $fileName, 'html' => $html,'dropdown'=>$dropdown], 200); } else { $this->myLogger->logme('error', 'Database insert failed.'); return $this->respond(['status' => false, 'code' => 404, 'message' => 'Failed to add document'], 200);