Skip to content

Commit

Permalink
Updated max upload size
Browse files Browse the repository at this point in the history
  • Loading branch information
vti committed Apr 14, 2011
1 parent 163a60a commit b1dddae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contrib/lamework
4 changes: 3 additions & 1 deletion lib/Look2RemoveMe/Action/Upload.pm
Expand Up @@ -20,11 +20,13 @@ sub run {

return $self->set_var('errors' => {image => 'Required'}) unless $upload;

my $max_size_in_megs =
Lamework::Registry->get('config')->{max_upload_size} || 10;

try {
Lamework::Exception->throw("Doesn't look like an image to me")
unless $upload->content_type =~ m{^image/};

my $max_size_in_megs = 1;
if ($upload->size > $max_size_in_megs * 1024 * 1024) {
Lamework::Exception->throw(
"File size is too big (max $max_size_in_megs Mb)");
Expand Down

0 comments on commit b1dddae

Please sign in to comment.