I am trying to use the UPLOAD_HOOK in 2.06 to track the progress of the upload. I understand the api doc. is out of sync, but from the Changes notes I gathered something like the following should work:
my $req = Apache2::Request->new($r , UPLOAD_HOOK => sub { $log->info("PARAMS: " . join(',', @_)); my ($upload, $data_len) = @_; $size_received = $size_received + $data_len; }) || $log->error("UP: could not create Apache2::Request"); Unfortunately it looks like my hook receives only one argument, the name of the file being uploaded. The log_info above generates this: [info] [client 192.168.0.117] PARAMS: 10M.bin,, I have also tried accessing $upload->size in the hook, without success - $upload seems to be a scalar. Any hint on how to achieve this would be greatly appreciated! Thanks, Franck