#!/usr/bin/perl #---------------------------- #FTP's single file to servage #By Benjamin Ruston #benjamin@digitalwombat.com #Ponder@DALnet #28th November 2006 #------ #Usage: ./sftp ~/dog.jpg /www/public #./sftp filename remotelocation #------ use strict; use warnings; use Net::FTP; my $file = $ARGV[0]; my $rloc = $ARGV[1]; my $host = "ftp.host.here"; my $ftp = Net::FTP->new($host, Debug => 0) or die "Could not connect to host $host : $@" #Login and password need to be set here $ftp->login("username",'password') or die "Failed to log in ", $ftp->message; $ftp->cwd($rloc) or die "Failed change working directory ", $ftp->message; $ftp->put($file) or die "Failed to transfer file ", $ftp->message; $ftp->quit;