Net::FTP pasv_xfer() using problem
by Kprasad other posts by this author
Jun 18 2009 6:52AM messages near this date
view in the new Beta List Site
Re: use case for activeState
|
RE: :FTP pasv_xfer() using problem
Hi
Please provide solution for below mentioned problem, message showing while executing below m
entioned script
CODE:
#!/usr/bin/perl
use Net::FTP;
use File::stat;
##I'm hoping to use pasv_xfer(sourcefile, dest_server) to do a server to server passive tran
sfer
$ftpout = Net::FTP-> new("192.168.180.188", Debug => 0)
or die "Cannot connect to 192.168.180.188: $@"; #destination server
$ftpout-> login("tj","tj") or die "Cannot login ", $ftpout->message;
warn "Failed to set binary mode\n" unless $ftpout-> binary();
$pwddirout=$ftpout-> pwd();
$ftpdest="$pwddirout/training";
print "Destination Directory $ftpdest\n";
$ftpin = Net::FTP-> new("192.168.180.192", Debug => 0)
or die "Cannot connect to 192.168.180.192: $@"; #source server
$ftpin-> login("iop123","iop312") or die "Cannot login ", $ftpin->message;
$pwddir=$ftpin-> pwd();
warn "Failed to set binary mode\n" unless $ftpin-> binary();
$ftpin-> pasv_xfer("ApJ306023.xml", $ftpdest);
$lsize = stat("c:/temp/apj_697_1_106ej.zip")-> size;
print "SIZE:- $lsize";
$ftpout-> quit() or die "FTP: Couldn't quit.";
$ftpin-> quit() or die "FTP: Couldn't quit.";
MESSAGE: Can't call method "port" without a package or object reference at C:/Perl/lib/Ne
t/FTP.pm line 1122.
Kanhaiya Prasad
Thread:
Kprasad
Brian Raven
|