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

In reply to Net::FTP and Microsoft FTP Service by brewmaker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.