<%attr> ajax => 1 <%args> $basedir $userfile <%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);

<% uri_unescape($userfile) %> @(Upload done)