I have 3 folders in my root, “application”, “system”, and “uploads”. In application/controllers/mycontroller.php I have this line of code.
delete_files("../../uploads/$file_name");
The file does not get deleted and I have tried a number of pathing options like ../ and ../../../ any ideas? Thanks.
$file_nameis a variable. You should concatenate it to your own string in order to execute the function:EDIT:
Make sure that this sentence:
Is echoing a valid path. If the answer is YES, try this:
Supposing that your “uploads” folder is in your root directory.
EDIT 2:
Using
unlinkfunction: