title: How to upload multiple files using Mojolicious?
body: <p>I'm new to Mojolicious, trying to learn it. I'm trying to upload multiple files using form but only one file is uploaded at a time. Any suggestion?</p>
  
  <pre><code>#!perl -w
  
  use Mojolicious::Lite;
  use Mojo::Upload;
  use v5.14;
  
  get '/' =&gt; 'page';
  post '/' =&gt; sub {
     my $self = shift;
     my @files;
     for my $file ($self-&gt;req-&gt;upload('files')) {
       my $size = $file-&gt;size;
       my $name = $file-&gt;filename;
  
       push @files, "$name ($size)";
       $file-&gt;move_to("C:\\Program Files\\Apache Software Foundation\\Apache24\\htdocs\\ProcessingFolder\\".$name);
     }
     $self-&gt;render(text =&gt; "@files");
  } =&gt; 'save';
  
  app-&gt;start;
  
  __DATA__
  
  @@ page.html.ep
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
     &lt;body&gt;
     &lt;form action="&lt;%=/ProcessingFolder/%&gt;" method="POST"
  enctype="multipart/form-data"&gt;
       &lt;input name="files" type="file" enctype="multipart/form-data" multiple="multiple"&gt;
       &lt;button type="submit"&gt;Upload&lt;/button&gt;
     &lt;/form&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>