Skip to content

Instantly share code, notes, and snippets.

@lucas1
Created September 14, 2011 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucas1/1216759 to your computer and use it in GitHub Desktop.
Save lucas1/1216759 to your computer and use it in GitHub Desktop.
Exemplo
arquivo TT:
<form action="[% c.uri_for(c.controller("Nome_do_controller").action_for("Nome_do_action")) %]" method="post" enctype="multipart/form-data">
<input type="file" name="arquivo" /><br />
<input type="submit" value="enviar" />
</form>
<br />
arquivo Controller:
sub Nome_do_action :Local{
my ( $self, $c ) = @_;
# UPLOAD
my $arquivo = $c->req->upload('arquivo');
$arquivo->copy_to('/fotos');
$c->res->body('Enviado com sucesso!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment