Hey,
I'm getting a weird problem. To reproduce it, I've set up a small =
template:
<PKIT_COMPONENT NAME=3D"/top">
<PKIT_MESSAGE>
<p>
<form method=3D"post" action=3D"upload_done" =
enctype=3D"application/x-www-form-urlencoded">=20
<input type=3D"file" name=3D"photo">=20
<input type=3D"hidden" name=3D"pkit_done" =
value=3D"http://<PKIT_HOSTNAME>">
<input type=3D"image" img src=3D"static/submit.png" =
width=3D"67" height=3D"20" border=3D"0" name=3D"submit" =
value=3D"Submit">
</form>
=20
<PKIT_COMPONENT NAME=3D"/bottom">
In MyModel.pm, I have the following subroutine (just to check the number =
of uploaded files):
sub upload_done {
my $model =3D shift;
my @filenames;
=20
foreach my $upload ( $model->apr->upload ) {
my $fh =3D $upload->name;
push @filenames, $fh;
}
=20
my $pkit_done =3D $model->input('pkit_done');
$model->pkit_gettext_message("file: ".$#filenames);
$model->pkit_redirect("upload"); =20
}
The problem is the result is always -1 (and if I try to access any =
$upload object, it's undefined).
Thank you for any help!
|