Hello, I have following code, and wondering why is it not changing directroy on remote server. The directory on the server exists. Please advise.
use strict; use warnings; use File::Copy; use Net::FTP; use Net::FTP::File; use Cwd; use Win32; my $ftp_remote_addr='server'; my $ftp_user = 'login'; my $ftp_pass ='pass'; my $ftp_cwd_path = ""; my $ftp_put_filename= 'C:\\ftp\\a\\move\\test.txt'; ############################################# my $ftp = Net::FTP->new($ftp_remote_addr,Timeout => 60, Debug => 0) || die "Connect to $ftp_remote_addr failed: $@"; $ftp->login($ftp_user, $ftp_pass) or die "Cannot login ", $ftp->mess +age; my $dir = '/ftp/agc/move'; $ftp->cwd($dir) or die "Can't cwd to $dir\n"; $ftp->message; $ftp->put($ftp_put_filename) or die "Failed to transfer file ", $f +tp->message; $ftp->quit;
Error- cannot cwd
thanks
In reply to FTP CWD not working by arm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |