#!C:/Perl/bin/perl.EXE -wT
# CGI program to check Taint problem while uploading file. It prompts
# for the of the file to be uploaded and displays the name of the
# uploaded file.
# Tested in:
# OS Windows-7 32 bit, Perl 5.22.3, Apache 2.2
# OS WindowsServer-2012 64 bit, Perl 5.24.2, Apache 2.4.20
# OS Centos-6.10 64 bit, Perl 5.26.1, Apache 2.2.15
use strict; use warnings;
use CGI;
use CGI::Carp qw (fatalsToBrowser warningsToBrowser);
my $q = new CGI;
my $p_upl_new_file = $q->param ("p_upl_new_file") || '';
&sPrintForm; exit;
###################################################################
sub sPrintForm {
print $q->header ();
print $q->start_html ();
print $q->start_form ({-name => "form1"});
print $q->h1 ({-align => "center"} , "File Upload Test");
print "
";
print $q->filefield (-name => 'p_upl_new_file');
print "
";
print $q->submit (-name => "action_submit" , -value => "Submit");
print "
";
print "File name $p_upl_new_file";
print $q->end_form;
print $q->end_html;
}
# END #############################################################