Advertisement
Guest User

Untitled

a guest
Jul 15th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.38 KB | None | 0 0
  1. use Mojolicious::Lite;
  2.  
  3. my @ext = qw/.jpg/;
  4. # /foo?user=sri
  5. post '/foo' => sub {
  6.  
  7.   my $c    = shift @_;
  8.   my $files = $c->req->uploads;
  9.   my @file_names;
  10.  
  11.   foreach my $id (@$files) {
  12.       my $i=0;
  13.       $file_names[$i] = $id->filename;
  14.       $i++;
  15.   }
  16.  
  17. my $file_1 = $files->[0]->filename;
  18.  
  19. $c->render(text => "First file => $file_1 ; FIle names -> @file_names");
  20. };
  21. app->start;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement