in reply to Uploading files using cgi.pm

You might investigate the upload() function. From the CGI docs:

$fh = $query->upload('uploaded_file'); while (<$fh>) { print; }

Replies are listed 'Best First'.
Re: Re: Uploading files using cgi.pm
by c (Hermit) on Nov 29, 2001 at 20:13 UTC
    I read through CGI.pm and see what you are referring to. The doc says that $fh will return a usable filehandle or undef if the param is not a valid filehandle.

    I changed my existing code to reflect your suggestion, however I kept my loop in place that stick forms values into a hash. So, I ended up with something like:

    my $fh = $query->upload($formdata{upload});

    This ended up coming back as undef, however once I removed my hash and made a direct query:

    my $fh = $query->upload('upload');

    it worked. Thanks for your help.

    -c