in reply to strange CGI.pm behavior

I've had trouble with this too. The solution I found was to use the upload() method to get a filehandle:
my $filename = $query->param('filename'); my $fh = $query->param('file'); # clean $filename, especially in Taint mode open(OUTPUT, '>' . $path . $filename) or carp "Can't open $filename: $ +!"; select(OUTPUT); print while (<$fh>);
Ugly, demo code, but that technique worked in my tests. See Re: CGI.pm file upload freaking me out for more information.

Replies are listed 'Best First'.
Re: Re: strange CGI.pm behavior
by flocto (Pilgrim) on Feb 11, 2001 at 07:18 UTC
    Thanks for your advice. I tried to use &CGI::upload and it worked fine on my workstation (again..). But it didn't work on the server. Basically the same thing. The error-message said that the routine doesn't exist. I guess there's something wrong with perl and/or CGI.pm.. I dropped the webmaster a note to check his installation..
    Regards,
    octopus
    --
    GED/CC d-- s:- a--- C++(+++) UL+++ P++++$ L++>++++ E--- W+++@ N o? K? w-- O- M-(+) V? !PS !PE !Y PGP+(++) t-- 5 X+ R+(+++) tv+(++) b++@ DI+() D+ G++ e->+++ h!++ r+(++) y+