Multiple File upload

Multiple File upload

am 28.12.2007 08:17:57 von vijay

Upload form
@files = 4;
for(my $i=1;$i<=scalar(@$files);$i++){
print "File $i Path: ";
print $query->filefield('excel');
print "

";
}

After form Submit
my @filehandles = $query->upload("excel");
print scalar(@filehandles); # Is always 1 even if I upload more than
one file

How do i upload multiple files with the same name and handle it using
cgi-lib?


Thanks
iavian

Re: Multiple File upload

am 29.12.2007 00:03:07 von Tad J McClellan

vijay@iavian.com wrote:

> @files = 4;


That array has one element in it.


> for(my $i=1;$i<=scalar(@$files);$i++){


Where have you defined $files?

You should always enable warnings and strict when developing Perl code:

use warnings;
use strict;

Assumming you meant @files instead of @$files, then the loop
will iterate 1 time, because that is what you told it to do.

If you want a loop that will iterate 4 times, then something
like this will do it:

foreach my $i ( 1 .. 4 )


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"

Re: Multiple File upload

am 01.01.2008 14:28:26 von Gunnar Hjalmarsson

vijay@iavian.com wrote:
> How do i upload multiple files with the same name and handle it using
> cgi-lib?

Unless somebody is inclined to give you a history lesson on cgi-lib.pl,
the Perl 5 module CGI::UploadEasy (with CGI.pm behind the scenes) will
probably do what you need.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Re: Multiple File upload

am 24.01.2008 01:27:27 von john.swilting

Gunnar Hjalmarsson wrote:

> vijay@iavian.com wrote:
>> How do i upload multiple files with the same name and handle it using
>> cgi-lib?
>
> Unless somebody is inclined to give you a history lesson on cgi-lib.pl,
> the Perl 5 module CGI::UploadEasy (with CGI.pm behind the scenes) will
> probably do what you need.
>
yes i do
that
at the same with my crew