$cgi_data{'note'}
The file has been spooled to disk as: $cgi_data{'upfile'}
The file's reported name on the client machine is:
$cgi_cfn{'upfile'}
The file's reported Content-type (possibly none) was:
$cgi_ct{'upfile'}
EOT
# Print the contents of the uploaded file
open (UPFILE, $cgi_sfn{'upfile'}) or
&CgiError("Error: Unable to open file $cgi_sfn{'upfile'}: $!\n");
$buf = ""; # avoid annoying warning message
while (read (UPFILE, $buf, 8192)) {
# Munge the uploaded text so that it doesn't contain HTML elements
# This munging isn't complete -- lots of illegal characters are left
# However, it takes care of the most common culprits.
$buf =~ s/</g;
$buf =~ s/>/>/g;
print $buf;
}
close (UPFILE);
print "\n";
unlink ($cgi_sfn{'upfile'}) or
&CgiError("Error: Unable to delete file",
"Error: Unable to delete file $cgi_sfn{'upfile'}: $!\n");
# cleanup - delete the uploaded file
# Note that when using spooling of files to disk, the uploaded file's
# name on the server machine is in both %cgi_data and %cgi_sfn
# (that is, the first and fourth parameters to ReadParse). However,
# for technical reasons, the data in %cgi_data are tainted. The data in
# %cgi_sfn are not tainted, but the keys can contain only a limited
# set of characters ([-\w] in cgi-lib 2.8)
print "