Hacked it by using
my $query = $self->query();
$query->close_upload_files(1);
if (my $file = $query->param('uploaded_file')) {
open (my $fh, '<', $query->{'.tmpfiles'}->{*$file}->{'name'}->as_string());
Anyway, I find it strange that query()->upload() doesn't work as expected under CGI::Application.
Serguei Trouchelle wrote:
> But when I tried to make similar things with CGI::App, I failed:> > ($self is a current CGI::App object here)> if (my $file = $self->query()->param('uploaded_file')) {> my $fh = $self->query()->upload('uploaded_file');> my $up_info = $self->query()->uploadInfo($fh);> my $type = $self->query()->uploadInfo($file)->{'Content-Type'};> my $file_content;> local $/;> $file_content = <$file>;> $self->errormessage(Data::Dumper->Dump([$file, $fh, $up_info, $file_content]));
--
Serguei Trouchelle