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) { get '/f/:dir/#name' => sub ($c) {
my $dir = $c->param("dir"); my $dir = $c->param("dir");
my $file = $c->param("name"); my $file = $c->param("name");
print $dir, $file . "\n";
my $ext = $file; my $ext = $file;
$ext =~ s/.*\.//; $ext =~ s/.*\.//;
$c->render_file( filepath => "f/".$dir . "/" . $file, my $path = "f/".$dir . "/" . $file;
format => 'jpg', #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' content_disposition => 'inline'
); )
};
};
app->max_request_size( 1024 * 1024 * 100 ); app->max_request_size( 1024 * 1024 * 100 );
post '/upload' => sub ($c) { handle_file($c) }; post '/upload' => sub ($c) { handle_file($c) };