Russ Jones | 2 Jul 2012 18:00

Limit bytes transfered in cURL request...

Is there an option to limit the number of bytes, perhaps to 200KB when downloading a file using cURL?

Thanks,

Russ

--
============================
Russ Jones, CTO
rjones <at> virante.com

Virante Inc.
101 J. Morris Commons Lane – Suite 105
Morrisville, NC 27560

P: 919-459-1035
F: 919-747-4362


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Dave Reisner | 2 Jul 2012 20:08
Gravatar

Re: Limit bytes transfered in cURL request...

On Mon, Jul 02, 2012 at 12:00:40PM -0400, Russ Jones wrote:
> Is there an option to limit the number of bytes, perhaps to 200KB when
> downloading a file using cURL?
> 
> Thanks,
> 
> Russ
> 
> --
> ============================
> Russ Jones, CTO
> rjones <at> virante.com
> 
> Virante Inc.
> 101 J. Morris Commons Lane – Suite 105
> Morrisville, NC 27560
> 
> P: 919-459-1035
> F: 919-747-4362
> 
> 

> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ:        http://curl.haxx.se/docs/faq.html
> Etiquette:  http://curl.haxx.se/mail/etiquette.html

Sure, the manpage details this option:

  --max-filesize <bytes>
        Specify  the  maximum size (in bytes) of a file to download. If
        the file requested is larger than this value, the transfer will
        not start and curl will return with exit code 63.

dave
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Gmane