use strict; use warnings; use IO::File; use File::Copy; my $control = sub{ my $self = shift; if( my @files = $self->param('upspot') ){ foreach my $f (@files){ # Handle für die anzulegende Datei my $fh = IO::File->new; # neu mit xCGI.pm $fh->open("c:/temp/".$f->filename, O_CREAT|O_BINARY|O_RDWR) or die $!; copy( $f->iohandle, $fh ) or die $!; # legacy CGI.pm $fh->open("c:/temp/$f", O_CREAT|O_BINARY|O_RDWR) or die $!; copy($f, $fh) or die $!; $fh->close; } $self->{CONTENT} = "Alle Dateien wurden gespeichert!"; } else{ $self->{CONTENT} = "Keine Dateien, aber alles OK!"; } };