![]() |
file delete problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: file delete problem (/showthread.php?tid=2243) |
file delete problem - El Forum - 07-25-2007 [eluser]rubai[/eluser] hi there i am trying to delete one file from localhost. but it fails. i write: Code: delete_files($_SERVER['DOCUMENT_ROOT'].'/project/uploads/'.$exists_image); but if i print the code it shows the right path. for example Code: C:/apachefriends/xampp/htdocs/project/uploads/image.jpg file delete problem - El Forum - 07-25-2007 [eluser]座頭市[/eluser] You might want to read the documentation a little more carefully... file delete problem - El Forum - 07-25-2007 [eluser]rubai[/eluser] Quote:You might want to read the documentation a little more carefully… thanks. but i wrote this post after reading the documentation and several tries. file delete problem - El Forum - 07-25-2007 [eluser]座頭市[/eluser] Read it again. file delete problem - El Forum - 07-25-2007 [eluser]woopsicle[/eluser] Ok, I think rather than repeatedly saying 'RTFM' it might be worth taking the 1 minute of my time to actually help this fellow. The delete_files function doesn't use the second parameter as you are trying to use it. The second parameter is TRUE or FALSE, where true means it will recursively delete all sub folder/files as well. You might want to look an unlink (http://au2.php.net/manual/en/function.unlink.php) as this is more suitable to delete a single file. file delete problem - El Forum - 07-25-2007 [eluser]座頭市[/eluser] <sigh> Apparently you're not familiar with or don't subscribe to the give a man a fish/teach a man to fish theory. ![]() file delete problem - El Forum - 07-25-2007 [eluser]woopsicle[/eluser] no i do.. but if he/she asks twice.. insisting they have read the manual.. then clearly they are fundamentally missing something when reading the manual. i.e. read a sentence and misinterpreting it... reading it 100 more times isn't going to change it. file delete problem - El Forum - 07-25-2007 [eluser]rubai[/eluser] thanks. it works nicely. may be delete_files() cannot delete single file. but in a previous post one says: Quote:Hey. I’m trying to write some code that deletes an image from a server. I’m using this code but for some reason it won’t delete the file:and others reply him. for this i think it is possible to use delete_files() for deleting single file. to 座頭市: if you not interested then must ignore posts. |