c8d0a1fcd3b5ee4233d88c5a4a023e"
=head2 upload_file
Works like C<upload_content>, but returns a JSON packet with additional metadata/information in
the body.
=head2 upload_image
Works like C<uploa
tored in the CAS.
Otherwise, the image is not resized, but resized dimensions are returned in the JSON packet
so the client can generate an C<img> tag for display.
Originally, L<Image::Resize> was a
s does nothing but accept a standard POST/Filedata upload and return it as base64 in a JSON
packet within the JSON/object key C<echo_content>.
=head1 METHODS
=head2 Content
Not usually called direc
::SimpleCAS::CSS::Simple; #<-- hack/workaround CSS::Simple busted on CPAN
use String::Random;
use JSON;
use Catalyst::Controller::SimpleCAS::MimeUriResolver;
# FIXME - This is old and broken - file
pe};
if ($rct eq 'JSON' || $rct eq 'text/x-rapidapp-form-response') {
$c->stash->{json}= { success => \1, content => $src_text };
return $c->forward('View::RapidApp::JSON');
}
# find
= @_;
die "No html content supplied" unless ($c->req->params->{html_enc});
my $html = decode_json($c->req->params->{html_enc})->{data};
# 'filename' param is optional and probably not supplied
tent;
use Module::Runtime;
use Try::Tiny;
use Catalyst::Utils;
use Path::Class qw(file dir);
use JSON;
use MIME::Base64;
use String::Random;
use Scalar::Util 'blessed';
has store_class => ( is => '
> $orig_height,
filename => $self->safe_filename($upload->filename),
};
return $self->_json_response($c, $packet);
}
sub _is_image_resize_available {
my $flag = 1;
try { Module::Runt
e => $Content->mimetype,
css_class => $Content->filelink_css_class,
};
return $self->_json_response($c, $packet);
}
sub safe_filename {
my $self = shift;
my $filename = shift;
m