Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP Not working.

Status
Not open for further replies.

WRXSTi03

Technical User
Dec 2, 2004
2
US
The following code hangs then fails with 'Can't open data connection' when trying to print a simple ls command. I installed FileZilla Server with all defaults settings.

When I ftp via linux, konsole it works fine. Via konsole if I tun passive off I reproduce the what appears to be the same failure, So Iremoved $ftp->passv; cmd and it still failes on executing the ls cmd... what gives ? I've done numerous searchs and cant find a fix.

Any suggestions ?

Code:
use Net::FTP;
use Net::Cmd;

$hostname = '192.168.1.100';
$username = 'ftp1';
$password = 'ftp1';

$home = '/';
#$remotefile = "test.txt";

#Connect Host
   $ftp = Net::FTP->new($hostname) || die("Failed to create object.\n");
   $ftp->login($username, $password) || die("Failed to login\n");
   $ftp->pasv || die("Failed to set passive mode.\n");
   #$ftp->quot('SYST');
   #$ftp->quot('FEAT');
   #$ftp->quot('EPSV');
    
#Change directory
   #$ftp->cwd($home), "\n";                 #Change to remote directory
   print $ftp->ls($home), "\n";            #Print remote directory, FAILS HERE.
    
#Disconnect from host
    #$ftp->binary;
    #print $ftp->quot('NLST');
    #$ftp->get($remotefile);                 #Get remote fi
    $ftp->quit;
 
Afer disabling my FireWall on my Linux box I was able to FTP from Linux to Windows to my FileZilla server.

Apparently from Linux with konsole the FW lets the traffic through, but from Komodo via perl is does not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top