dru145 has asked for the wisdom of the Perl Monks concerning the following question:
Tr( { -style => "background-color:#CCCCCC" }, td( strong( "Enter the file you want to upload" ) ), td( filefield( { -name=>'file', -default=>'starting value', -size=>30, -maxlength=>80 } ) ), #end td ), #end Tr
#!/usr/bin/perl -w use strict; use CGI::Carp 'fatalsToBrowser'; use CGI qw/:standard/; my @lines; my $filehandle = upload('file') or die "No file uploaded!"; my $message1 = "<u>The Following Data was inserted into the Database < +/u>"; do_work(); display_page("$message1"); sub do_work { while (<$filehandle>){ push (@lines, $_); } } sub display_page { my $message = "$_[0]"; print header, start_html( "-title" => "Results Page"), p(" "), p( strong( $message ) ), p(" "), p("@lines"), end_html; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(ichi) Re: Uploading a File with CGI.pm
by ichimunki (Priest) on Apr 11, 2002 at 19:23 UTC | |
by dru145 (Friar) on Apr 11, 2002 at 19:49 UTC | |
|
Re: Uploading a File with CGI.pm
by tachyon (Chancellor) on Apr 11, 2002 at 19:29 UTC |