Alright fixed more bugs

This commit is contained in:
(≧◡≦) 2023-02-12 13:42:18 +01:00
parent dcea6b2a24
commit 4fcd649b0b
No known key found for this signature in database
GPG key ID: B39C0BCEE94A4A89

View file

@ -86,15 +86,17 @@ post '/' => sub ($c) { handle_file($c) };
get '/f/:dir/#name' => sub ($c) {
my $dir = $c->param("dir");
my $file = $c->param("name");
print $dir, $file . "\n";
my $ext = $file;
$ext =~ s/.*\.//;
$c->render_file( filepath => "f/".$dir . "/" . $file,
format => 'jpg',
my $path = "f/".$dir . "/" . $file;
#carp "sakisafe warning: could not get file: $ERRNO" unless
$c->render(text => "file not found", status => 404) unless -e $path;
$c->render_file( filepath => $path,
format => $ext,
content_disposition => 'inline'
);
};
)
};
app->max_request_size( 1024 * 1024 * 100 );
post '/upload' => sub ($c) { handle_file($c) };