line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
10
|
|
|
10
|
|
903
|
use strict; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
558
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package HTML::FormFu::Element::File; |
4
|
|
|
|
|
|
|
$HTML::FormFu::Element::File::VERSION = '2.07'; |
5
|
|
|
|
|
|
|
# ABSTRACT: File upload form field |
6
|
|
|
|
|
|
|
|
7
|
10
|
|
|
10
|
|
175
|
use Moose; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
82
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
extends 'HTML::FormFu::Element'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with 'HTML::FormFu::Role::Element::Input'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
after BUILD => sub { |
14
|
|
|
|
|
|
|
my $self = shift; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$self->field_type('file'); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$self->form->enctype('multipart/form-data'); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
return; |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=pod |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=encoding UTF-8 |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
HTML::FormFu::Element::File - File upload form field |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 VERSION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
version 2.07 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
--- |
44
|
|
|
|
|
|
|
elements: |
45
|
|
|
|
|
|
|
type: File |
46
|
|
|
|
|
|
|
name: photo |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $photo = $form->param('photo'); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $blob = $photo->slurp; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 DESCRIPTION |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
File upload form field. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
See the documentation relevant to the L<query_type|HTML::FormFu/query_type> |
57
|
|
|
|
|
|
|
you're using: |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=over |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item L<HTML::FormFu::QueryType::CGI> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item L<HTML::FormFu::QueryType::Catalyst> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item L<HTML::FormFu::QueryType::CGI::Simple> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=back |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 METHODS |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SEE ALSO |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Is a sub-class of, and inherits methods from |
74
|
|
|
|
|
|
|
L<HTML::FormFu::Role::Element::Input>, |
75
|
|
|
|
|
|
|
L<HTML::FormFu::Role::Element::Field>, |
76
|
|
|
|
|
|
|
L<HTML::FormFu::Element> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
L<HTML::FormFu> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 AUTHOR |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Carl Franks, C<cfranks@cpan.org> |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 LICENSE |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
87
|
|
|
|
|
|
|
the same terms as Perl itself. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 AUTHOR |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Carl Franks <cpan@fireartist.com> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This software is copyright (c) 2018 by Carl Franks. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
98
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |