php - Deleting files using CodeIgniter? -


I'm not sure it's a work to delete a file (where an image is). $ this-> Load-> Assistant ('file'); However, this list lists that this function has to delete the whole directory, and there is no mention of how it handles different files (if a path is given only for 1 file). Before I started testing with it, I thought I would check what someone has done before this problem?

I just want to use a codeigniter function to delete the uploaded images (user profile images say) but I am unable to find anything in the documentation / user guide Helps me achieve it (yes, I know that I need proper permission for first and everybody, but it is beyond the scope of this question).

About Unlink ()

What was I hoping to do in a CI function that would allow me to "allow someone to be removed" Stupid or other factors like "file is in use". I got unlinked () sometimes does not work (throwing me without any errors) so why did I ask ...

As I posted in the comments, you get the unlink () function of PHP However, it returns a E_WARNING error upon returning false. As I said in the comments, you can use the error suppression, but still handles the error properly, should it fail to delete the file < / Div>

Comments