[dancer-users] Image Uploader
Richard Reina
gatorreina at gmail.com
Sat Sep 5 22:54:58 BST 2015
> 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 at 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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20150905/d5a882d3/attachment.html>
More information about the dancer-users
mailing list