Advertisement
Guest User

Untitled

a guest
Jul 15th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.33 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->upload('file');
  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.  
  18. $c->render(text => "File names => @file_names");
  19. };
  20. app->start;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement