From 8df4731f857409de3053d9cc527b12aa90b01236 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Fri, 6 Feb 2026 18:02:54 +0530 Subject: [PATCH] FIX_ISSUE --- app/Controllers/EmployeeRestController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index aa7cd9e..ad822a1 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -4245,13 +4245,13 @@ class EmployeeRestController extends AdminController $file_id = $this->request->getGet('id') ?? $id; // Find record - $record = $this->hrFileUploadModel->find($file_id); + $record = $this->fileModel->where('id', $file_id)->first(); if (!$record) { return $this->failNotFound("File record not found"); } - $uploadPath = WRITEPATH . 'uploads/hr_files/'; + $uploadPath = WRITEPATH . 'uploads/excel/'; $filePath = $uploadPath . $record['file_name']; if (!file_exists($filePath)) { @@ -4259,8 +4259,8 @@ class EmployeeRestController extends AdminController } // Force file download - return $this->response->download($filePath, null) - ->setFileName($record['file_name']); + return $this->response->download($filePath, null)->setFileName($record['file_name']); + } catch (\Exception $e) { return $this->failServerError($e->getMessage()); }