in reply to Re^3: Having an issue with my CGI.pm file uploads
in thread Having an issue with my CGI.pm file uploads

my CGI.pm version is 3.10

If I try:

my $upload_filehandle = $i->upload( 'JARFILE' ); binmode($upload_filehandle);
I get the following error in my apache log:
Can't use an undefined value as a symbol reference
...so now I am confused, why my filehandle is not getting defined. It is on a valid file upload field, as again, the file(complete with its remote name) is getting created at 0 bytes on the server.

Replies are listed 'Best First'.
Re^5: Having an issue with my CGI.pm file uploads
by mr_mischief (Monsignor) on Sep 25, 2007 at 21:59 UTC
    The CGI.pm docs say that the upload() method will return undef if the argument is not a valid file handle. It doesn't go into much detail about what would cause that to be the case.

    One thing CGI.pm will try to do is to save the uploaded file in your temporary directory. On *nix, that's usually /tmp, but it may differ under certain setups. On Windows, depending on server software and such, c:/temp, d:/temp, c:/windows/temp, 'c:/documents and settings/user/local settings/temp' and others are all possibilities. CGI.pm may have issues if it can't do that due to permissions, so that's a good place to check.