Hi,

I tried to ftp a file to a server using perl. I am able to connect to the server, but file is not transfered. [size of the file is zero bytes]. If i copy and paste it manually [ ftp command prompt] it is going. but not through perl].

The code i used is below,
===============
#!/usr/bin/perl

use Net::FTP::File;
use Net::FTP;


my $ftp = Net::FTP->new("ip", Debug => 0)
or die "Cannot connect to some.host.name: [email protected]";

$ftp->login("user","pwd")
or die "Cannot login ", $ftp->message;
$ftp->cwd("/testing");
print "\n Connected to FTP \n".
$ftp->binary();
$success = $ftp-> put("sample.jpg") or print "\n".$ftp->message;
print $success;
my $file_ = $ftp-> size("sample.jpg");
print "remote file size:$file_\n";

$ftp->quit;
===================
i am getting error message as "Failed to establish connection". I do know where the problem is.Please help me to trace out the problem.

Thanks.
P.Gerald Manickam