Net::FTP doesn't transfer files
I have a simpe script that is supose to upload a local file to a given
ftp server. There are no problems in logging in, and the file appears
on the remote ftp server, but the problem is that it contains no data.
The script runs perfectly on any other server, but not my FreeBSD
server. Here is the script:
#############################################
#!/usr/bin/perl
print "Content-type: text/html\n\n";
use Net::FTP;
$ftp = Net::FTP->new("ftp.server.com");
$ftp->login("username","password");
#$ftp->binary;
#$ftp->put("/path/to/file.gif","file.gif") or die $ftp->message;
$ftp->quit;
print "DONE\n\n";
#############################################
When I run the script, it just hangs for a while (seems like a
timeout). The file name that was supose to be transfered, appears on
the remote ftp server right away, but as I said, it contains no data.
I've also run the FTP client app. on the FreeBSD server via SSH, works
fine! I've checked that the Net::FTP module is installed, and it is.
The strange thing is that it works, but just half way... I've also
tried to fetch files from the remote ftp server, without any luck...
Any suggestions on what the reason could be, or how I can figure out a
solution?
Thanks!
Regards,
Morten
|