bling
12-27-2003, 12:40 PM
The new version of CGI.pm incorporates hooks into the file upload process (http://search.cpan.org/~lds/CGI.pm-3.01/CGI.pm#CREATING_A_FILE_UPLOAD_FIELD) (scroll down a little) during the file upload. Very similar to the Apache::Request UPLOAD_HOOK functionality, it allows the generation of a progress meter during upload.
But I can't get the functionality in CGI.pm to work.
Even using the sample code (on the page linked above):
use CGI qw(upload_hook);
$q = CGI->new();
$q->upload_hook(&hook,$data);
sub hook {
my ($filename, $buffer, $bytes_read, $data) = @_;
print "Read $bytes_read bytes of $filename\n";
}
I still get this response:
Read bytes of Apache::RequestRec=SCALAR(0x83cb6a0)
The system is Redhat 9, mod_perl 1, perl 5.8.0.
But I can't get the functionality in CGI.pm to work.
Even using the sample code (on the page linked above):
use CGI qw(upload_hook);
$q = CGI->new();
$q->upload_hook(&hook,$data);
sub hook {
my ($filename, $buffer, $bytes_read, $data) = @_;
print "Read $bytes_read bytes of $filename\n";
}
I still get this response:
Read bytes of Apache::RequestRec=SCALAR(0x83cb6a0)
The system is Redhat 9, mod_perl 1, perl 5.8.0.