I am writing a script that uses Net::FTP to grab a file from a Win32 client. Everything works up to the point where it transfers the file. I tried the same script on a linux client and it worked. I'm not sure what the problem is. I am posting the ftp section of the script and the debug output.
#!/usr/bin/perl -w
my $host = "192.168.10.155";
my $file_name = "/home/testuser/filestore/WWWMSEXP.TXT";
my $dir = "mail";
my $getname ="WWWMSEXP.TXT";
my $username = "testuser";
my $password = "secret";
use Net::FTP;
$ftp = Net::FTP->new($host, Timeout =>40, Debug =>1) or die "can't con
+nect to host";
$ftp->login($username,$password) or die "can't log in to host";
$ftp->cwd($dir) or die "can't change directory";
$ftp->ascii();
$ftp->get($getname,$file_name) or die "can't get file";
$ftp->quit();
The debug:
Net::FTP: Net::FTP(2.64)
Net::FTP: Exporter(5.562)
Net::FTP: Net::Cmd(2.21)
Net::FTP: IO::Socket::INET(1.25)
Net::FTP: IO::Socket(1.26)
Net::FTP: IO::Handle(1.21)
Net::FTP=GLOB(0x819dea4)<<< 220 Microsoft FTP Service
Net::FTP=GLOB(0x819dea4)>>> user testuser
Net::FTP=GLOB(0x819dea4)<<< 331 Password required for testuser.
Net::FTP=GLOB(0x819dea4)>>> PASS ....
Net::FTP=GLOB(0x819dea4)<<< 230 User testuser logged in.
Net::FTP=GLOB(0x819dea4)>>> CWD mail
Net::FTP=GLOB(0x819dea4)<<< 250 CWD command successful.
Net::FTP=GLOB(0x819dea4)>>> TYPE A
Net::FTP=GLOB(0x819dea4)<<< 200 Type set to A.
Net::FTP=GLOB(0x819dea4)>>> PORT 192,168,10,221,9,213
Net::FTP=GLOB(0x819dea4)<<< 200 PORT command successful.
Net::FTP=GLOB(0x819dea4)>>> RETR WWWMSEXP.TXT
Net::FTP=GLOB(0x819dea4)<<< 150 Opening ASCII mode data connection for
+ WWWMSEXP.TXT(3180636 bytes).
can't get file at ./mtest.pl line 18.
The file IS there and I can manually ftp to this client and get it.
Somebody hit me with a clue stick!
Thanks
Mike