aisa/libs/modules/uploader.pm

31 lines
845 B
Perl
Raw Normal View History

2025-11-26 09:31:54 +00:00
sub uploader_filmfreight {
my ($file_to_upload,$ftp_dir,$ftp_file_name,$delete_file_to_upload) = @_ ;
use Net::FTP;
my $host = "154.0.175.152"; # filmfreight.co.za
my $user = "filmfree";
my $password = "h0lNH8fMzrrWUC";
my $ftp = Net::FTP->new($host) or die "Can't open $host : $!\n" ;
$ftp->login($user, $password) or die "Can't log $user in : $!\n" ;
$ftp->cwd($ftp_dir) or die "Can't cwd to $ftp_dir\n";
$ftp->binary() or die "Can't change to binary mode"; # Unix and Windows switch $ftp->ascii();
$ftp->put($file_to_upload, "$ftp_dir/$ftp_file_name") or die "Can't put $file_to_upload into $ftp_dir\n" ;
$ftp->quit;
# if ($delete_file_to_upload eq 'y') {
# unlink ("$file_to_upload") ;
# }
} #-------------------------------------------------------------------------------------------------------------
1;