### Sending data with POST request if required
my $url_post = $cg->param('url_post');
$url_post ||= $c->{url_post};
if($url_post)
{
my ($str,@har);
for (0..$#fileslots)
{
push @har, { name=>"$fileslots[$_]_original",'value'=>$filenames[$_] };
push @har, { name=>"$fileslots[$_]", 'value'=>$filenames2[$_] };
push @har, { name=>"$fileslots[$_]_status", 'value'=>$file_status[$_] };
}
for my $k (@params)
{
my @arr = $cg->param($k);
for my $p (@arr)
{
next if ref $p eq 'Fh'; #&& $p !~ /\.$c->{ext_allowed}$/i; # Skip unallowed files
$p =~ s/.*\\([^\\]*)$/$1/;
push @har, { name=>$k, value=>$p };
}
}
push @har, { name=>'target_dir', value=>$c->{target_dir} };
print" ";
exit;
}
|