random + upload   15

Simple Mojolicious::Lite upload
#!/usr/bin/env perl

use Mojolicious::Lite;

any '/upload' => sub {
my $self = shift;

# Check file size
return $self->render(text => 'File is too big.', status => 200)
if $self->req->is_limit_exceeded;

# Process uploaded file
if (my $example = $self->req->upload('example')) {
my $size = $example->size;
my $name = $example->filename;
$self->render(text => "Thanks for uploading $size byte file $name.");
}
};

app->start;

__DATA__

@@ upload.html.ep
<!DOCTYPE html>
<html>
<head><title>Upload</title></head>
<body>
% my @attrs = (method => 'POST', enctype => 'multipart/form-data');
%= form_for upload => @attrs => begin
%= file_field 'example'
%= submit_button 'Upload'
% end
</body>
</html>
mojo  file  upload  form  example 
june 2018 by random
jUploadr | SourceForge.net
Flickr website is too slow to upload, maybe this will be better.
flickr  upload  software 
august 2014 by random
Ge.tt | Gett sharing
Can upload a whole directory at once. Very, very easy to use!
file  sharing  storage  upload  hosting  host  share 
july 2011 by random

Copy this bookmark:



description:


tags: