use CGI; use strict; my $query = new CGI; if ( $query->upload('file') ) { my ($fh,$info,$sourcefilename,$targetdir); my ($targetfilename, $type); $fh = $query->upload('file'); $info = $query->uploadInfo($fh)->{'Content-Disposition'}; $sourcefilename = "somefile.dat"; if ($info =~ m/filename="(.*?)"/) { $sourcefilename = $1; } $type = $query->uploadInfo($fh)->{'Content-Type'}; $targetdir = "\\\\Giotto\\recourse"; $targetfilename = "$targetdir\\$sourcefilename"; print "
The target directory for this file is: $targetdir";
print "
The info about this upload field was: $info";
print "
The original filename was : $sourcefilename";
print "
The type was : $type";
print "
This makes the target path: $targetfilename";
open(OUT, ">$targetfilename");
binmode($fh);
while(<$fh>) {
print OUT;
}
close OUT;
}