dru145 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w # Display all erors to screen $|++; # autoflush buffers; use CGI::Carp 'fatalsToBrowser'; print "Content-type: text/html\n\n"; use strict; use CGI qw/:standard/; my $infile = upload('file') or die "File was not uploaded correctly\n" +; test(); display_page(); open (OUT, ">/tmp/uploaded") or die "Can't open file: $!\n"; sub test { my $buffer; while ( read($infile,$buffer,1024) ) { print OUT $buffer; } } sub display_page { my $message = "$_[0]"; print header, start_html( "-title" => "Results Page"), p(" "), p("$infile was uploaded correctly" ), p(" "), end_html; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(cLive ;-) Re: More CGI File Upload Woes
by cLive ;-) (Prior) on Apr 24, 2002 at 20:39 UTC | |
by dru145 (Friar) on Apr 25, 2002 at 00:00 UTC | |
|
Re: More CGI File Upload Woes
by Moonie (Friar) on Apr 24, 2002 at 21:04 UTC | |
|
Re: More CGI File Upload Woes
by bassplayer (Monsignor) on Apr 24, 2002 at 20:27 UTC |