I am using codeigniter 3.1.4. I am trying to delete a file in a folder in the root directory. When I use the unlink function as
$path=base_url()."files/image.jpg"; unlink($path);
I got the following error:
A PHP Error was encountered Severity: Warning Message: unlink(): http does not allow unlinking Filename: controllers/Deletion.php Line Number: 12 Backtrace: File: C:\xampp\htdocs\deletiontesting\application\controllers\Deletion.php Line: 12 Function: unlink File: C:\xampp\htdocs\deletiontesting\index.php Line: 315 Function: require_once
When I use the file assistant for this purpose as
$this->load->helper('file'); $path=base_url()."files/image.jpg"; delete_files($path);
The file is not deleted. The file name is image.jpg the folder name is the files. Please help me delete this file.
source share