Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use warnings; use CGI qw/:standard/; use POSIX; print header, start_html('upload form'); print start_form(), table( Tr( td("File: "), td(filefield(-name=>'upload', -size=>50, -maxlength=>80), ), ), Tr( td(), td(submit('button','submit'), ) ) ), end_form(), hr; if (param()) { my $upload = param('upload'); open (OUTFILE,">>/home/myname/public_html/upload") or die "cannot +open directory for writing $!"; while ($bytesread=read($upload,$buffer,1024)) { print OUTFILE $buffer; print "the thing is open"; } print "The file should be uploaded if everything went right, which it probably didn't.\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: file uploading
by Mr. Muskrat (Canon) on Apr 15, 2003 at 17:01 UTC | |
by Anonymous Monk on Apr 15, 2003 at 17:14 UTC | |
by Mr. Muskrat (Canon) on Apr 15, 2003 at 17:24 UTC | |
by Anonymous Monk on Apr 15, 2003 at 17:59 UTC | |
by chromatic (Archbishop) on Apr 15, 2003 at 18:39 UTC | |
by benn (Vicar) on Apr 15, 2003 at 22:21 UTC | |
|
Re: file uploading
by perlplexer (Hermit) on Apr 15, 2003 at 17:03 UTC |