Hi, folks,
Here is my question.
Perl script in windows.
#! usr/bin/perl
use NET::FTP;
$upload_ftp_site = "xx.xx.x.xx";
$userid = "xxx";
$passwd = "xxxxxxxx";
$local_file = "C:\\path1\test.txt";
$ftp = Net::FTP->new($upload_ftp_site, Timeout=>30, Debug=>0);
$ftp->login($userid, $passwd) || die("ID $Login/$Passwd : $!\n"
$ftp->binary();
$ftp->cwd("remote_dir\\ftp\\"
if ($ftp->put("$local_file") {
print"Ok\n";
}
else {
print "error\n";
}
the script always puts the file in the root path "home\\ instead of "home\\
I tried the cwd as "home\\ "\\home\\ " "\\ and "\\remote_dir\\ftp\\". they didnot work.
My userid and passwd are used to login to "home\\ of the remote server if I ftp through cmd window.
can anyone help me to work it out? thanks.
Here is my question.
Perl script in windows.
#! usr/bin/perl
use NET::FTP;
$upload_ftp_site = "xx.xx.x.xx";
$userid = "xxx";
$passwd = "xxxxxxxx";
$local_file = "C:\\path1\test.txt";
$ftp = Net::FTP->new($upload_ftp_site, Timeout=>30, Debug=>0);
$ftp->login($userid, $passwd) || die("ID $Login/$Passwd : $!\n"
$ftp->binary();
$ftp->cwd("remote_dir\\ftp\\"
if ($ftp->put("$local_file") {
print"Ok\n";
}
else {
print "error\n";
}
the script always puts the file in the root path "home\\ instead of "home\\
I tried the cwd as "home\\ "\\home\\ " "\\ and "\\remote_dir\\ftp\\". they didnot work.
My userid and passwd are used to login to "home\\ of the remote server if I ftp through cmd window.
can anyone help me to work it out? thanks.