Welcome Guest, Not a member yet? Register   Sign In
How to check if remote folder exists (CI FTP class)
#1

[eluser]Anthony Hull[/eluser]
Hey,

I have this code:

Code:
$this->ftp->mkdir($remote_path)

The trouble is, I get an error message if the remote folder already exists.. how do I check if it exists first before creating it?

Thanks!

Anthony
#2

[eluser]Anthony Hull[/eluser]
Ok, I think I got it working. Here is the code I used:

Code:
if(!$this->ftp->mirror($local_path, $remote_path))
            {
                $this->ftp->mkdir($remote_path);
                $this->ftp->mirror($local_path, $remote_path);
                $this->ftp->mirror('/home/rmrs/public_html/members/uploader/tmp/'.$randstring.'/', $remote_path); //upload config file    
            }
            else
            {
                $this->ftp->mirror($local_path, $remote_path);
                $this->ftp->mirror('/home/rmrs/public_html/members/uploader/tmp/'.$randstring.'/', $remote_path); //upload config file    
            }




Theme © iAndrew 2016 - Forum software by © MyBB