1. Create Rest_controller.php inside controllers and paste code: <?php defined('BASEPATH') OR exit('No direct script access allowed'); require APPPATH . '/libraries/API_Controller.php'; class Rest_controller extends API_Controller { public function __construct() { parent::__construct(); } public function index() { $this->api_return( [ 'status' => true, 'result' => "Welcome to Testservices." ], 200); } } ?> 2. Create api.php inside config and paste code : <?php defined('BASEPATH') OR exit('No direct script access allowed'); /** * API Key Header Name */ $config['api_key_header_name'] = 'X-API-KEY'; /** * API Key GET Request Parameter Name */ $config['api_key_get_name'] = 'key'; /** * API Key POST Request Parameter Name ...
A Passionate full stack developer with 7 years of amazing experience in full stack application development and expertise in technologies like React Native, NextJS, ReactJS, Codeigniter, PHP , NodeJs. He has huge craze in learning new things about technologies and constantly shares his knowledge with others.
SET PERMISSION
ReplyDelete$destFile = __DIR__ . '/uploads/' . $random_filename . $ext;
move_uploaded_file($_FILES['file_poster']['tmp_name'], $destFile);
chmod($destFile, 0666);