Fix file handling more

This commit is contained in:
Citlali del Rey 2023-02-06 21:20:21 -08:00
parent d21452c39b
commit c359c831f8
Signed by: nullobsi
GPG Key ID: 933A1F44222C2634
1 changed files with 2 additions and 2 deletions

View File

@ -178,7 +178,7 @@ sub upload_post($c) {
my $uid = $c->stash('uid');
my $app_name = $c->stash('app_name');
my $file = $c->req->upload('file');
my $file = $c->param('file');
my $filename = $file->filename;
my $is_browser = $c->param('is_browser');
@ -191,7 +191,7 @@ sub upload_post($c) {
return $c->redirect_to('/my');
}
if ($file->size > $max_size) {
if ($file->size > $max_size || $c->req->is_limit_exceeded) {
$c->flash(msg => "Max file size reached. (10MB)");
return $c->redirect_to('/my');
}