getContent(), true); if (isset($data["path"])) { if (file_exists($data["path"])) { $fileContents = file_get_contents($data['path']); $base64File = base64_encode($fileContents); return $respond->createBodyObject(new CommonResponseView($base64File, $method, $key, 'success'))->respond(); } else { throw new NotFoundMaestroException("File does not exist !", $method, $key); } } else { throw new ForbiddenMaestroException("No path provided !", $method, $key); } } }