#!/D:/perl/bin/-w # a module making life easier use strict; use Net::FTP; my $destserv="ftp.somewhere.com"; my $user="user"; my $password="password"; my $dir = "/my/directory"; my $file_to_put = "ftptest2.txt"; my $ftp = Net::FTP->new($destserv) or die "Can't Open $destserv\n"; $ftp->login($user,$password); $ftp->cwd($dir) or die "Can't cwd to $dir\n"; $ftp->ascii(); $ftp->pasv(); $ftp->put($file_to_put) or die "Unsuccessful transfer:$@\n"; $ftp->quit();
Edit by tye
In reply to Net::FTP creates empty file by doesntmatter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |