%attr> ajax => 1 %attr> <%args> $basedir $userfile %args> <%init> my $query = $m->cgi_object; $basedir = uri_unescape($basedir); # get a filehandle for the uploaded file # print out the contents of the uploaded file open(FILE, ">$basedir/$userfile") or die " cant open file: $basedir/$userfile $!"; my $fh = $query->upload('userfile'); while (<$fh>) { print FILE $_; } close($fh); close(FILE); %init>