ecuguru has asked for the wisdom of the Perl Monks concerning the following question:
$ftpobj = Net::FTP -> new ("server.com",Debug =>1,Timeout=>60); $ftpobj -> login("user","pass"); $ftpobj -> binary; $ftpobj -> cwd ("/Users/a/code/perl/ftptest"); $ftpobj -> delete ("/Users/a/code/perl/ftptest/testfile.txt"); $ftpobj -> put ("/Users/a/code/perl/testfile.txt","/Users/a/code/perl/ +ftptest/testfile.txt"); $ftpobj -> quit; print "file size ",-s "testfile.txt"," bytes\n";
Net::FTP>>> Net::FTP(2.75) Net::FTP>>> Exporter(5.567) Net::FTP>>> Net::Cmd(2.26) Net::FTP>>> IO::Socket::INET(1.26) Net::FTP>>> IO::Socket(1.27) Net::FTP>>> IO::Handle(1.21) Net::FTP=GLOB(0x889f84)<<< 220 server.com FTP server (lukemftpd 1.1) r +eady. Net::FTP=GLOB(0x889f84)>>> user a Net::FTP=GLOB(0x889f84)<<< 331 Password required for a. Net::FTP=GLOB(0x889f84)>>> PASS .... Net::FTP=GLOB(0x889f84)<<< 230- Net::FTP=GLOB(0x889f84)<<< Welcome to Darwin! Net::FTP=GLOB(0x889f84)<<< 230 User a logged in. Net::FTP=GLOB(0x889f84)>>> TYPE I Net::FTP=GLOB(0x889f84)<<< 200 Type set to I. Net::FTP=GLOB(0x889f84)>>> CWD /Users/a/code/perl/ftptest Net::FTP=GLOB(0x889f84)<<< 250 CWD command successful. Net::FTP=GLOB(0x889f84)>>> DELE /Users/a/code/perl/ftptest/testfile.tx +t Net::FTP=GLOB(0x889f84)<<< 250 DELE command successful. Net::FTP=GLOB(0x889f84)>>> ALLO 23 Net::FTP=GLOB(0x889f84)<<< 202 ALLO command ignored. Net::FTP=GLOB(0x889f84)>>> PORT 69,82,120,222,214,103 Net::FTP=GLOB(0x889f84)<<< 200 PORT command successful. Net::FTP=GLOB(0x889f84)>>> STOR /Users/a/code/perl/ftptest/testfile.tx +t Net::FTP=GLOB(0x889f84): Timeout at ftp.pl line 10 Net::FTP=GLOB(0x889f84)>>> QUIT Net::FTP=GLOB(0x889f84)<<< 425 Can't build data connection: Operation +timed out. file size 23 bytes
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::FTP question. Better way?
by dave_the_m (Monsignor) on Dec 08, 2004 at 13:03 UTC | |
by ecuguru (Monk) on Dec 08, 2004 at 19:21 UTC | |
by Anonymous Monk on May 30, 2017 at 19:40 UTC |