|
|
@ -4,7 +4,8 @@ use strict; |
|
|
|
use warnings; |
|
|
|
use warnings; |
|
|
|
use utf8; |
|
|
|
use utf8; |
|
|
|
|
|
|
|
|
|
|
|
use POSIX qw(strftime tmpnam); |
|
|
|
use POSIX qw(strftime); |
|
|
|
|
|
|
|
use File::Temp qw(tempfile); |
|
|
|
use Mojo::Base 'Mojolicious::Controller'; |
|
|
|
use Mojo::Base 'Mojolicious::Controller'; |
|
|
|
use Mojo::Asset::File; |
|
|
|
use Mojo::Asset::File; |
|
|
|
use Mojo::Util qw(b64_encode b64_decode decode encode); |
|
|
|
use Mojo::Util qw(b64_encode b64_decode decode encode); |
|
|
@ -97,7 +98,7 @@ sub save { |
|
|
|
die("empty paste\n") unless $paste; |
|
|
|
die("empty paste\n") unless $paste; |
|
|
|
} elsif ($source eq 'file') { |
|
|
|
} elsif ($source eq 'file') { |
|
|
|
require File::MimeInfo::Magic; |
|
|
|
require File::MimeInfo::Magic; |
|
|
|
my $tmpfile = tmpnam(); |
|
|
|
my ($fh, $tmpfile) = tempfile(); |
|
|
|
my $maxsize = $self->app->config->{zerobin}->{maxsize}; |
|
|
|
my $maxsize = $self->app->config->{zerobin}->{maxsize}; |
|
|
|
my $upload = $self->req->upload('file'); |
|
|
|
my $upload = $self->req->upload('file'); |
|
|
|
die("empty uploaded file\n") |
|
|
|
die("empty uploaded file\n") |
|
|
|