Thread FTP Programm Upload (25 answers)
Opened by duerov at 2005-11-22 14:33

esskar
 2005-11-22 16:32
#60310 #60310
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
und hier auch noch ne schnell variante

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
use strict;
use warnings;
use Net::FTP;

my $path = 'c:/temp';

my $ftp = Net::FTP->new("host.de") or die "Konnte keine Verbindung aufbauen $!";
$ftp->login("name", "passwort") or die "Login failed: $!";
if(opendir(my $handle, $path)) {
  while(my $file = readdir $handle) {
     next if $file =~ m#^\.\.?$#;
     $ftp->put($path . '/' . $file);
  }
  closedir $handle;
}
$ftp->quit;
\n\n

<!--EDIT|esskar|1132669962-->

View full thread FTP Programm Upload