Hi,
I have the following code to delete a folder & files on a remote server using the code ignitor ftp class, however am getting an error and i'm not sure why. Here is what i tried. Any help appriciated.
1. Show me the files on the remote server, which confirms the path is correct.
2. I then tried to chmod the folder for permissions as thought that might be the problem why it was not deleting
3. Attempt to delete the directory.
It is returning the following, as I have debug mode turned on.
An Error Was Encountered
Unable to delete the file.
I have the following code to delete a folder & files on a remote server using the code ignitor ftp class, however am getting an error and i'm not sure why. Here is what i tried. Any help appriciated.
1. Show me the files on the remote server, which confirms the path is correct.
Code:
Array ( [0] => ./example/derbyshire [1] => ./example/northamptonshire [2] => ./example/kent [3] => ./example/sprayfoaminsulation.html [4] => ./example/east-sussex [5] => ./example/hampshire [6] => ./example/surrey )2. I then tried to chmod the folder for permissions as thought that might be the problem why it was not deleting
3. Attempt to delete the directory.
PHP Code:
$list = $this->ftp->list_files("./example/"); // check there is files.
print_r($list);
$this->ftp->chmod('./example/', 0777); // change permissions
$this->ftp->delete_dir('./example/'); // try to delete
$this->ftp->close(); // close
It is returning the following, as I have debug mode turned on.
An Error Was Encountered
Unable to delete the file.