in reply to Getting a filehandle for uploaded file

The code snippet in CGI (in PROCESSING_A_FILE_UPLOAD_FIELD) tells us:
$lightweight_fh = $q->upload('field_name'); # undef may be returned if it's not a valid file handle . . .
Hence the problem you're seeing is not entirely unexpected - by Lincoln Stein i.e. the module author, anyway;-)

A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^2: Getting a filehandle for uploaded file
by luker (Initiate) on Oct 20, 2009 at 13:51 UTC
    I noticed that too. So what's the alternative?

      One would think the user didn't upload a file or an error occured (too big?). You can use

      defined($file_from_upload) && defined(fileno($file_from_upload))
      to determine if the param was supplied and that it was supplied as a file upload.
      Hmmm, maybe this will be of use ... to us both ;-)

      A user level that continues to overstate my experience :-))
        Again, there the advice is to use:
        my $upload_filehandle = $query->upload("photo");
        and then read from the $upload_filehandle. In my case, the $upload_filehandle is coming back undef.