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   16 use strict;
  3         6  
  3         67  
3 3     3   11 use warnings;
  3         5  
  3         72  
4 3     3   12 use base qw/FormValidator::Lite::Upload/;
  3         11  
  3         619  
5              
6             sub new {
7 11     11 0 16 my ($class, $q, $name) = @_;
8 11         23 my $file = $q->param($name);
9 11 50       213 return unless $file;
10              
11 11         77 my $info = $q->uploadInfo($file);
12 11         255 bless {
13             q => $q,
14             name => $name,
15             info => $info,
16             }, $class;
17             }
18              
19 6     6 0 35 sub size { shift->{info}->{'Content-Length'} }
20 7     7 0 71 sub type { shift->{info}->{'Content-Type'} }
21              
22             sub fh {
23 2     2 0 5 my ($self, ) = @_;
24 2         9 $self->{q}->upload($self->{name});
25             }
26              
27             1;