Hi,
i'm trying to setup a ls command using Net::FTP.
First, i show you my code
my $ftp = Net::FTP->new( $row->{ftp_host}, Debug => 1)
or die "Cannot connect to " . $row->{ftp_host} . ": $@";
$ftp->login($row->{username}, $row->{password})
or die "Cannot login ", $ftp->message;
$ftp->cwd("/logs/web")
or die "Cannot change working directory ", $ftp->message;
$ftp->pasv;
my @dir = $ftp->ls; # <-- LINE 50
the trace looks as follows:
Net::FTP>>> Net::FTP(2.75)
+
Net::FTP>>> Exporter(5.58)
+
Net::FTP>>> Net::Cmd(2.26)
+
Net::FTP>>> IO::Socket::INET(1.27)
+
Net::FTP>>> IO::Socket(1.28)
+
Net::FTP>>> IO::Handle(1.24)
+
Net::FTP=GLOB(0x8521bbc)<<< 220 Microsoft FTP Service
+
Net::FTP=GLOB(0x8521bbc)>>> user xxxxxxxxxx
+
Net::FTP=GLOB(0x8521bbc)<<< 331 Password required for xxxxxxxxxx.
+
Net::FTP=GLOB(0x8521bbc)>>> PASS ....
+
Net::FTP=GLOB(0x8521bbc)<<< 230 User xxxxxxxxxx logged in.
+
Net::FTP=GLOB(0x8521bbc)>>> CWD /logs/web
+
Net::FTP=GLOB(0x8521bbc)<<< 250 CWD command successful.
+
Net::FTP=GLOB(0x8521bbc)>>> PASV
+
Net::FTP=GLOB(0x8521bbc)<<< 227 Entering Passive Mode (64,74,223,25,15
+,182).
Net::FTP=GLOB(0x8521bbc)>>> PORT 192,168,1,101,130,121
+
Net::FTP: Unexpected EOF on command channel at getenomlogs.pl line 50
I googled abou the 'Unexpected EOF on command channel' error, and it seems to be a aktiv <=> passiv FTP problem.
But i already did entering passiv mode (i also have to check this option in my ftp client to get a proper connection) but why is Net::FTP setting up a PORT command - isn't that the command for establishing an aktiv connection?
Does anybody know what to do?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|