Welcome Guest, Not a member yet? Register   Sign In
chmod and unlink file....
#1

[eluser]mangpeps[/eluser]
Guys can someone help me here ?

I want to create a module where the user can delete their uploaded images via http... Whenever I tried to use the http://, it gives some errors... But when I tried yo directly type the location of the folder, it was good but I want to use http delete for beta version... here is the code


chmod("localhost/ci3/simages/", 0777);

$imagenya=site_url('simages/'.$this->uri->segment(3));


if (@unlink($imagenya)Wink {
echo "deleted na";

$this->Admins->deleteimgpath($id);
}
#2

[eluser]Yorick Peterse[/eluser]
In order to remove data from the filesystem you need to provide the relative path to the file instead of the full one. That's why /my/file.php works and http://www.domain.tld/my/file.php doesn't.
#3

[eluser]mangpeps[/eluser]
Thanks man... Yeah, when I tried to look again at the manual, it is included there, might as well blame my eyes for not seeing it but anyway thanks again man.




Theme © iAndrew 2016 - Forum software by © MyBB