> From: Torsten Förtsch <torsten.foert...@gmx.net> > > Best would be if you could make an educated guess based on the Content-Length > request header if the uploaded file will exceed the limit. Most clients send > an "Expect: 100-continue" header and thus give the server a chance to > decline > the request *before* the body is sent. If the body is already on the way the > only thing you can do is to close the connection. I don't know if httpd does > > that immediately or if it reads and discards the whole body.
> The code below is the relevant piece of CGI.pm. So, yes, the upload hook gets > the data as it is written to the temp file. > > while (defined($data = $buffer->read)) { > if (defined $self->{'.upload_hook'}) { > $totalbytes += length($data); > &{$self->{'.upload_hook'}}($filename ,$data, $totalbytes, > $self->{'.upload_data'}); > } > print $filehandle $data if ($self->{'use_tempfile'}); > } > thanks for all the knowledge Torsten (and everyone else). This stuff is the holy grail I have been looking for for years. This is a fantastic list! Mike Cardeiro