CGI::uploadInfo returning undef?

L

Lord0

Hi there,

Need a bit of help with CGI::uploadInfo method - I'm sure I used to be able
to get it to work.....

# snippet

use CGI qw/all/;

my $q=new CGI;

my $file=$q->param('my_resource'); # yes it is a multi-part form generated
using start_multipart_form()

if($file){
# getting here fine

my $upload_info1=$q->uploadInfo($file);
my $upload_info2=$q->uploadInfo($q->upload('my_resource')); # trying to
use the filehandle instead

# both undef?
}

# end snippet

When I run this code both $upload_info1 AND $upload_info2 are undef?!? I can
successfully upload and save the file but I just can't seem to get the
header information.

Any ideas?

Cheers

Lord0
 
G

Gunnar Hjalmarsson

Lord0 said:
use CGI qw/all/;

my $q=new CGI;

my $file=$q->param('my_resource'); # yes it is a multi-part form generated
using start_multipart_form()

if($file){
# getting here fine

my $upload_info1=$q->uploadInfo($file);
my $upload_info2=$q->uploadInfo($q->upload('my_resource')); # trying to
use the filehandle instead

# both undef?
}

# end snippet

When I run this code both $upload_info1 AND $upload_info2 are undef?!? I can
successfully upload and save the file but I just can't seem to get the
header information.

You may want to try the CPAN module CGI::UploadEasy to avoid the hazzle.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top