I am having trouble making remote directory using ftp.
I am getting error as Warning: ftp_mkdir(): Can't create directory: No such file or directory
I am trying this way.
$connection = ftp_connect($hostname) or die('Couldn\'t connect to ftp server');
$login = ftp_login($connection, $username, $password) or die('Couldn\'t log_in to ftp server');
ftp_pasv($connection, true);
if ($login){echo 'Connected Successfully.';}else{echo 'Cannot connect.';}
$dir = '2014/04/09';
if(!@ftp_chdir($connection, '/public_html/images/'.$dir)){
$ftp_mkdir = ftp_mkdir($connection, '/public_html/images/'.$dir);
if($ftp_mkdir){
echo 'Remote directory created successfully';
}
else{
echo 'Error creating remote directory';
}
}
else{
echo 'Remote directory exist';
}
Please see and suggest any possible way to do this.
Thanks.