in reply to Re: Bad file descriptor when uploading file via CGI
in thread Bad file descriptor when uploading file via CGI

Thanks for the upload() tip. I found an example here at the monastery and plugged it into my code. Worked wonderfully.

Here's my revised code:

$| = 1; my ($file,$path) = @_; my $filename = $query->upload($file); my $buffer; open(OUTPUT, ">$path/$filename"); binmode($filename); binmode(OUTPUT); while( read($filename, $buffer, 64*2**10) ) { print OUTPUT $buffer; } close(OUTPUT); return ($filename);

I would still like to know what the original problem was, but right now I just need a solution.


—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot