1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
use strict; use warnings; use Net::FTP; use constant HOSTNAME => 'ftp.ul.net'; use constant USERNAME => 'username' ; use constant PASSWORD => 'sicher123'; my $host = Net::FTP->new(HOSTNAME) or die "Cannot connect to ", HOSTNAME, ": $!\n"; $host->login(USERNAME, PASSWORD) or die "login error: ", $host->message, $/; $host->put (test.txt) or die "cannot put test.txt: ", $host->message, $/; $host->quit;
2012-12-26T15:29:10 KarlaCluftWo würede ich es denn normalerweise hin geben?
2012-12-26T15:38:22 GwenDragonDa muss niemand irgendwo den Pfad wechseln zum Upload.
2012-12-26T16:02:44 GwenDragonWo muss der Pfad extra gewechselt werden?
Quoteput ( LOCAL_FILE [, REMOTE_FILE ] )
Put a file on the remote server. LOCAL_FILE may be a name or a filehandle. If LOCAL_FILE is a filehandle then REMOTE_FILE must be specified. If REMOTE_FILE is not specified then the file will be stored in the current directory with the same leafname as LOCAL_FILE.
Returns REMOTE_FILE, or the generated remote filename if REMOTE_FILE is not given.
NOTE: If for some reason the transfer does not complete and an error is returned then the contents that had been transferred will not be remove automatically.
1 2
my $host = Net::FTP->new(HOSTNAME, Debug => 1) or die "Cannot connect to ", HOSTNAME, ": $@\n";
2012-12-26T16:05:41 KarlaCluftNet::FTP=GLOB(0xd24b2c)>>> ALLO 5