i'd use scp to transfer the file, there's a good article about passwordless ssh here
http://www.hackinglinuxexposed.com/a.../20030109.html
otherwise, this'll do it via ftp with perl:
#!/usr/bin/perl -w
my $username = 'user';
my $password = 'pass';
my $host = 'host';
my $file = 'file.tgz';
open(FTPHOST, "|ftp -n $host\n");
print FTPHOST "user $username $password\n";
print FTPHOST "bin\n";
print FTPHOST "prompt off\n";
print FTPHOST "put $file\n";
print FTPHOST "exit\n";
close(FTPHOST);