Strange. It works for me.
Try to use $upload->move_to().
use File::Temp 'tempfile';
...
} else {
my $tfile = File::Temp->new;
$file->move_to($tfile->filename);
$post = $ua->post($url => { 'Content-Type' => $mimetype } => form => { file
=> { file => $tfile->filename }} );
}
2014-08-30 0:29 GMT+04:00 rasta <[email protected]>:
> But if I do this, the $file (Mojo::Upload) seems to contain an empty
> asset, as if it rewrites what was there.
>
> 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' )
>
> On Friday, August 29, 2014 4:46:12 PM UTC+2, Александр Грошев wrote:
>>
>> $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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>
--
С уважением, Александр Грошев.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.