![]() |
I can not remove folder - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: I can not remove folder (/showthread.php?tid=73752) |
I can not remove folder - bomi - 05-30-2019 I'm trying to delete a record from database and remove its own folder. You can see the code below. I wrote "problem occurred- ALWAYS WORK THIS IF". I can not solve this problem. I'm waiting for your help ![]() PHP Code: public function delete($incomingId) RE: I can not remove folder - donpwinston - 05-30-2019 The directory must be empty for rmdir() to work. RE: I can not remove folder - kilishan - 05-30-2019 Most likely either the directory is not empty or your script doesn't have permission to delete it. If it's not empty, you could try the file_helper and its delete_files method, which will delete all files within the directory and can optionally delete the directory itself. RE: I can not remove folder - InsiteFX - 05-30-2019 It could also contain a hidden file which you would not see. RE: I can not remove folder - bomi - 05-30-2019 Okay it's my fault. I changed this Old code (not work) PHP Code: $delete_folder = rmdir($path); PHP Code: $delete_folder = delete_files($path); |