diff options
Diffstat (limited to 'contrib/perl5/eg/cgi/file_upload.cgi')
-rw-r--r-- | contrib/perl5/eg/cgi/file_upload.cgi | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/perl5/eg/cgi/file_upload.cgi b/contrib/perl5/eg/cgi/file_upload.cgi index f6bbbe0..3037de7 100644 --- a/contrib/perl5/eg/cgi/file_upload.cgi +++ b/contrib/perl5/eg/cgi/file_upload.cgi @@ -1,5 +1,6 @@ #!/usr/local/bin/perl -w +use strict 'refs'; use lib '..'; use CGI qw(:standard); use CGI::Carp qw/fatalsToBrowser/; @@ -11,14 +12,14 @@ print strong("Version "),$CGI::VERSION,p; print h1("File Upload Example"), 'This example demonstrates how to prompt the remote user to select a remote file for uploading. ', - strong("This feature only works with Netscape 2.0 browsers."), + strong("This feature only works with Netscape 2.0 or greater, or IE 4.0 or greater."), p, 'Select the ',cite('browser'),' button to choose a text file to upload. When you press the submit button, this script will count the number of lines, words, and characters in the file.'; -@types = ('count lines','count words','count characters'); +my @types = ('count lines','count words','count characters'); # Start a multipart form. print start_multipart_form(), @@ -31,9 +32,10 @@ print start_multipart_form(), endform; # Process the form if there is a file name entered -if ($file = param('filename')) { - $tmpfile=tmpFileName($file); - $mimetype = uploadInfo($file)->{'Content-Type'} || ''; +if (my $file = param('filename')) { + my %stats; + my $tmpfile=tmpFileName($file); + my $mimetype = uploadInfo($file)->{'Content-Type'} || ''; print hr(), h2($file), h3($tmpfile), |