line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::Request::Upload; |
2
|
66
|
|
|
66
|
|
57412
|
use strict; |
|
66
|
|
|
|
|
140
|
|
|
66
|
|
|
|
|
1821
|
|
3
|
66
|
|
|
66
|
|
278
|
use warnings; |
|
66
|
|
|
|
|
128
|
|
|
66
|
|
|
|
|
1369
|
|
4
|
66
|
|
|
66
|
|
280
|
use Carp (); |
|
66
|
|
|
|
|
86
|
|
|
66
|
|
|
|
|
22604
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
11
|
|
|
11
|
0
|
105
|
my($class, %args) = @_; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
bless { |
10
|
|
|
|
|
|
|
headers => $args{headers}, |
11
|
|
|
|
|
|
|
tempname => $args{tempname}, |
12
|
|
|
|
|
|
|
size => $args{size}, |
13
|
|
|
|
|
|
|
filename => $args{filename}, |
14
|
11
|
|
|
|
|
58
|
}, $class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
3
|
|
|
3
|
1
|
1435
|
sub filename { $_[0]->{filename} } |
18
|
0
|
|
|
0
|
0
|
0
|
sub headers { $_[0]->{headers} } |
19
|
1
|
|
|
1
|
1
|
32
|
sub size { $_[0]->{size} } |
20
|
2
|
|
|
2
|
0
|
64
|
sub tempname { $_[0]->{tempname} } |
21
|
7
|
|
|
7
|
1
|
749
|
sub path { $_[0]->{tempname} } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub content_type { |
24
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
25
|
1
|
|
|
|
|
14
|
$self->{headers}->content_type(@_); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
0
|
0
|
0
|
sub type { shift->content_type(@_) } |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub basename { |
31
|
2
|
|
|
2
|
1
|
7
|
my $self = shift; |
32
|
2
|
50
|
|
|
|
10
|
unless (defined $self->{basename}) { |
33
|
2
|
|
|
|
|
14
|
require File::Spec::Unix; |
34
|
2
|
|
|
|
|
3
|
my $basename = $self->{filename}; |
35
|
2
|
|
|
|
|
11
|
$basename =~ s|\\|/|g; |
36
|
2
|
|
|
|
|
35
|
$basename = ( File::Spec::Unix->splitpath($basename) )[2]; |
37
|
2
|
|
|
|
|
11
|
$basename =~ s|[^\w\.-]+|_|g; |
38
|
2
|
|
|
|
|
9
|
$self->{basename} = $basename; |
39
|
|
|
|
|
|
|
} |
40
|
2
|
|
|
|
|
7
|
$self->{basename}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
__END__ |