On Thu, Jul 12, 2001 at 10:41:32AM -0400, Will Cottay wrote:
: The only reason I'm posting an example of how to do this is so
: that I can feel better about commenting on just how excruciatingly
: bad your code is.
Bad tone for this list...
: I shudder to think that you are teaching software techniques to
: anyone.
This comment is far from necissary...
: If you provided an example like that to Tom Christiansen, I'm not
: surprised that he was a bit harsh with you. As far as asking him to
: solve your little file upload problem, you should be embarrassed to
: clutter his mail with such trivia.
In all honesty, I wager that even Tom doesn't feel *this* way about
questions asked of him...
: BTW, I've been writing code since the 70's also and I'm a bit curious.
: Have you got your first program running yet?
And this is entirely over the edge. Please do not waste thousands of
peoples time with with this attitude, it is extremley unwelcome.
: -will
:
: #!/usr/bin/perl -w
:
: use strict;
: use CGI qw(:all);
:
: my $q = new CGI;
: print $q->header;
: print $q->start_html(-title=>'File Upload Example');
:
: my $filename = $q->param('img');
:
: $| = 1;
:
: print $q->start_multipart_form(-name=>'fup');
: print $q->filefield(-name=>'img');
: print "<input type='submit' name='sfile'></form>";
: print $q->end_html;
:
: if ($filename) {
: my ($fn, $fout, $buffer, $bytesread);
: ($fn) = $filename =~ m!([^/|\\]+)$!;
:
: $fout = $ENV{DOCUMENT_ROOT} . '/photos/ptmp/' . $fn;
:
: open (OUTFILE,"> $fout") or die "Can't open $fout: $!";
: print OUTFILE $buffer while ($bytesread = read($filename, $buffer, 1024));
: close OUTFILE;
: }
This is a much bettter and much more welcome answer.
Casey West
--
Shooting yourself in the foot with AMIGA-DOS
The gun works pretty well, except that few people use one and it's
impossible to find bullets.