- or download this
use CGI;
use File::Basename;
...
my $fullfilename = $cgi->upload("file");
my ($filename, $type) = split '\.', basename($fh);
- or download this
# untaint filename and type
$filename =~ s/[^A-Za-z0-9_-]//g;
...
print FILE $uploaded;
}
close FILE or die "$!";
- or download this
my $fullfilename = $cgi->upload("file");
my $filename = reverse((split(/\//,
reverse($fullfilename)))[0]);