in reply to Re: Re: Re: CGI Uploading (repost)
in thread CGI Uploading (repost)
#!/usr/bin/perl -w use warnings; use CGI qw/:standard/; use CGI::Carp 'fatalsToBrowser'; 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 $filename = param('upload'); while (<$filename>) { print; } open (OUTFILE,">>/home/myname/public_html/upload") || die $!; while ($bytesread=read($filename,$buffer,1024)) { print OUTFILE $buffer; print "the thing is open"; } close $filename; print "The file should be uploaded if everything went right, which it +probably didn't.\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: CGI Uploading (repost)
by benn (Vicar) on Apr 17, 2003 at 09:21 UTC | |
|
Re: Re: Re: Re: Re: CGI Uploading (repost)
by marinersk (Priest) on Apr 17, 2003 at 15:35 UTC |