fireburner69
Programmer
for($i=0, $j=0; $i < $size ; $i++)
{
$file_upload = $cg->param("image_$i");
if(defined ($file_upload)) {
my $fh = $cg->upload("image_$i");
if(defined $fh)
{
#carp $fh;
($tmp_fh, $tmp_filename) = tempfile();
while(<$fh>) {
print $tmp_fh $_;
}
close($tmp_fh);
$fsize =(-s $fh);
$fh =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
$tmp_filename =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
$qstring .= "file[name][$j]=$fh&file[size][$j]=$fsize&";
$qstring .= "tmp_name[name][$j]=$tmp_filename&";
$j++;
}
}
}
I can understand that it loops through an array or something!
But what I really want to know is does it create any file!
And if yes How can I set the a path to where to save them!
Thanks in advance!
{
$file_upload = $cg->param("image_$i");
if(defined ($file_upload)) {
my $fh = $cg->upload("image_$i");
if(defined $fh)
{
#carp $fh;
($tmp_fh, $tmp_filename) = tempfile();
while(<$fh>) {
print $tmp_fh $_;
}
close($tmp_fh);
$fsize =(-s $fh);
$fh =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
$tmp_filename =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
$qstring .= "file[name][$j]=$fh&file[size][$j]=$fsize&";
$qstring .= "tmp_name[name][$j]=$tmp_filename&";
$j++;
}
}
}
I can understand that it loops through an array or something!
But what I really want to know is does it create any file!
And if yes How can I set the a path to where to save them!
Thanks in advance!