Have a look on https://metacpan.org/pod/Dancer::Request::Upload
for Dancer2 - Dancer2::Core::Request::Upload.

Here is a working example for Dancer:
https://github.com/mestia/simpleshare/blob/8129bc86d9f7b524117bc3d392b6f6a8c886aa69/lib/multifileupload.pm


_______________________________________________
dancer-users mailing list
dancer-users@dancer.pm
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

Hello Alex and Attila,

Been playing with the request->upload example but can't but when I hit upload all that appears is the "1" in the top left corner of the page.

my $upload_route = '/upload';
my $upload_dir = '/tmp';

get '/upload' => sub {
    template 'upload' => {
        upload_file => $upload_route,
    };
};

post '/upload' => sub {
    my $file = request->upload('file');
        my $fname = $file->filename;
        my $tmpname = $file->tempname;
        my $destination = $upload_dir . '/' . $fname;
        $file->copy_to($destination);
        unlink $tmpname if -e $tmpname;

    print "Done\n";
};

true;


Any idea what I might have done wrong?