RE: :FTP pasv_xfer() using problem
by Brian Raven other posts by this author
Jun 18 2009 7:30AM messages near this date
view in the new Beta List Site
Net::FTP pasv_xfer() using problem
|
LWP Help
From: perl-win32-users-bounces@[...].com
[mailto:perl-win32-users-bounces@[...].com] On Behalf Of
Kprasad
Sent: 18 June 2009 14:52
To: perl-win32-users@[...].com
Subject: Net::FTP pasv_xfer() using problem
> Hi
>
> Please provide solution for below mentioned problem, message showing
while executing below mentioned script
>
> CODE:
>
> #!/usr/bin/perl
The first thing wrong with your code is the absence of "use strict;" and
"use warnings;" at the start.
> use Net::FTP;
> use File::stat;
> ##I'm hoping to use pasv_xfer(sourcefile, dest_server) to do a server
to server passive transfer
Here's a clue ..............................^^^^^^^^^^^
>
> $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);
You haven't specified the destination server. Perhaps $ftpout?
> $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.
HTH
--
Brian Raven
This e-mail may contain confidential and/or privileged information. If you are not the inten
ded recipient or have received this e-mail in error, please advise the sender immediately by
reply e-mail and delete this message and any attachments without retaining a copy.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is stric
tly forbidden.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Kprasad
Brian Raven
|