File Coverage

blib/lib/FormValidator/Lite/Upload/CGI.pm
Criterion Covered Total %
statement 18 18 100.0
branch 1 2 50.0
condition n/a
subroutine 7 7 100.0
pod 0 4 0.0
total 26 31 83.8


line stmt bran cond sub pod time code
1             package FormValidator::Lite::Upload::CGI;
2 3     3   10 use strict;
  3         5  
  3         72  
3 3     3   9 use warnings;
  3         4  
  3         98  
4 3     3   13 use base qw/FormValidator::Lite::Upload/;
  3         4  
  3         616  
5              
6             sub new {
7 11     11 0 11 my ($class, $q, $name) = @_;
8 11         20 my $file = $q->param($name);
9 11 50       159 return unless $file;
10              
11 11         75 my $info = $q->uploadInfo($file);
12 11         231 bless {
13             q => $q,
14             name => $name,
15             info => $info,
16             }, $class;
17             }
18              
19 6     6 0 26 sub size { shift->{info}->{'Content-Length'} }
20 7     7 0 87 sub type { shift->{info}->{'Content-Type'} }
21              
22             sub fh {
23 2     2 0 4 my ($self, ) = @_;
24 2         10 $self->{q}->upload($self->{name});
25             }
26              
27             1;