I searched on the net but I didn't find a good answer. my problem is I want to delete images which are uploaded in a folder named upload in my application root my website is in codeigniter when I click on delete link to delete an image it gives this error:
Severity: Warning
Message: unlink(): http does not allow unlinking
my code is:
$a = base_url()."public/uploads/".$file_name;
unlink($a);
The problem you have is that base_url() will return the URL of your website, not the local filesystem path.
You should be able to get this to work by using the FCPATH constant instead, which will provide the path to the CodeIgniter root directory:
$a = FCPATH."public/uploads/".$file_name
Other constants you may find useful are APPPATH and BASEPATH which point respectively to the application/ and system/ directories.