[dancer-users] Upload form tutorial

Maxwell Carey mcarey at ucar.edu
Tue Sep 2 21:10:31 BST 2014

Not quite a tutorial, but the docs for Dancer::Request::Upload
<https://metacpan.org/pod/Dancer::Request::Upload#SYNOPSIS> contain a good,
simple example:

# somewhere in your view:
<form action="/upload" method="POST" enctype="multipart/form-data">
  <input type="file" name="filename">
  <input type="submit">

# and then in your application handler:
post '/upload' => sub {
  my $file = request->upload('filename');
  $file->copy_to($upload_dir);  # or whatever you need

On Tue, Sep 2, 2014 at 1:53 PM, Alex Becker <asb.cpan at gmail.com> wrote:

> Dear all,
> is there a tutorial how to create a Perl upload form with Dancer?
> Something basic and simple like this but without CGI? ->
> http://www.perlmeme.org/tutorials/cgi_upload.html
> Because, when I was a real noob, I learned Perl from scripts like these.
> And I still enjoy learning new things this way.
> Regards,
> Alex
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20140902/33f6883b/attachment.html>

More information about the dancer-users mailing list