comment
This commit is contained in:
parent
929538f486
commit
3bb9ef5b55
1 changed files with 1 additions and 11 deletions
12
fotostore.pl
12
fotostore.pl
|
@ -145,6 +145,7 @@ get '/' => sub {
|
||||||
} => 'index';
|
} => 'index';
|
||||||
|
|
||||||
# Upload image file
|
# Upload image file
|
||||||
|
# There is no restriction for file size in app because restriction is present in nginx configuration
|
||||||
post '/upload' => ( authenticated => 1 ) => sub {
|
post '/upload' => ( authenticated => 1 ) => sub {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
@ -163,17 +164,6 @@ post '/upload' => ( authenticated => 1 ) => sub {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Upload max size
|
|
||||||
#my $upload_max_size = 3 * 1024 * 1024;
|
|
||||||
|
|
||||||
# Over max size
|
|
||||||
#if ($image->size > $upload_max_size) {
|
|
||||||
# return $self->render(
|
|
||||||
# template => 'error',
|
|
||||||
# message => "Upload fail. Image size is too large."
|
|
||||||
# );
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Check file type
|
# Check file type
|
||||||
my $image_type = $image->headers->content_type;
|
my $image_type = $image->headers->content_type;
|
||||||
my %valid_types = map { $_ => 1 } qw(image/gif image/jpeg image/png);
|
my %valid_types = map { $_ => 1 } qw(image/gif image/jpeg image/png);
|
||||||
|
|
Loading…
Reference in a new issue