my $file = $self->req->upload('file');if($file->asset->is_file){
$post = $ua->post($url => { 'Content-Type' => $mimetype } => form => { file => { file => $file->asset->path }} );
}else{
what should I do here???
}$file = $self->req->upload('file')->asset(Mojo::Asset::File->new);
And all assets will be stored to files.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Do I have to mess with creating a temp file first? Or can I feed the user agent with the asset somehow?
my $upload = $self->req->upload('file')->asset(Mojo::Asset::File->new);
$self->app->log->debug($self->app->dumper($upload->asset));
--->
[Fri Aug 29 22:15:09 2014] [debug] bless( {}, 'Mojo::Asset::File' )Example. Please.
--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Looked here:...
# POST request with upload streamed from asset
my $asset = Mojo::Asset::Memory->new->add_chunk('lalala');
my $tx = $t->tx(
POST => 'http://example.com' => form => {mytext => {file => $asset}});$post = $ua->post($url => { 'Content-Type' => $mimetype } => form => { file => { file => $upload->asset }} );OK you've got your frag man! (: