summaryrefslogtreecommitdiff
path: root/eg/cgi/file_upload.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'eg/cgi/file_upload.cgi')
-rw-r--r--eg/cgi/file_upload.cgi12
1 files changed, 9 insertions, 3 deletions
diff --git a/eg/cgi/file_upload.cgi b/eg/cgi/file_upload.cgi
index 1f9eaec332..f6bbbe0b74 100644
--- a/eg/cgi/file_upload.cgi
+++ b/eg/cgi/file_upload.cgi
@@ -1,7 +1,8 @@
-#!/usr/local/bin/perl
+#!/usr/local/bin/perl -w
+use lib '..';
use CGI qw(:standard);
-use CGI::Carp;
+use CGI::Carp qw/fatalsToBrowser/;
print header();
print start_html("File Upload Example");
@@ -32,9 +33,12 @@ print start_multipart_form(),
# Process the form if there is a file name entered
if ($file = param('filename')) {
$tmpfile=tmpFileName($file);
+ $mimetype = uploadInfo($file)->{'Content-Type'} || '';
print hr(),
h2($file),
- h3($tmpfile);
+ h3($tmpfile),
+ h4("MIME Type:",em($mimetype));
+
my($lines,$words,$characters,@words) = (0,0,0,0);
while (<$file>) {
$lines++;
@@ -52,6 +56,8 @@ if ($file = param('filename')) {
}
}
+# print cite("URL parameters: "),url_param();
+
print hr(),
a({href=>"../cgi_docs.html"},"CGI documentation"),
hr,