On Wednesday, May 25, 2016 at 10:27:14 AM UTC-7, Peng Li wrote:
>
> but when I test the example on the website, I test this example
>
> http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Large-file-downloads
>
> use Mojo::UserAgent;
> # Fetch the latest Mojolicious tarballmy $ua = 
> Mojo::UserAgent->new(max_redirects => 5);my $tx = 
> $ua->get('https://www.github.com/kraih/mojo/tarball/master');
> $tx->res->content->asset->move_to('mojo.tar.gz');
>
>
> this code doesn't work for me, it indeed generate a new file mojo.tar.gz, 
> but the size is 0B.
>

This code worked fine for me; the downloaded tarball size is 651k, so no 
problems with the default MOJO_MAX_MESSAGE_SIZE.

Maybe you have permissions and/or network issues on your host that's 
preventing you from writing the file?  The Mojo::UserAgent example [1] 
shows how to query $tx to see if an error was returned from your request; I 
would suggest seeing if an error was returned, and if so, what the error is.

My environment:

OS X Yosemite 10.10.5
Perl version: 5.22.1
Mojolicious version: 6.58

Thanks,

Brian

[1] https://metacpan.org/pod/Mojo::UserAgent#SYNOPSIS

-- 
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 https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to