curl-users
Re: Size condition
From: Daniel Stenberg <Daniel.Stenberg_at_haxx.nu>
Date: Thu, 25 May 2000 15:31:57 +0200 (MET DST)
Date: Thu, 25 May 2000 15:31:57 +0200 (MET DST)
On Thu, 25 May 2000, Robert Fejer wrote:
> Is there a way to instruct curl to retrieve (through HTTP) only the files
> within given size limits?
>
> In my case, I have a list of images, and want to get only the ones
> smaller than 50 KB...
Yes. Well, there's no built-in "get-if-size-is-less-than" functionality, but
you can easily write a wrapper that does so.
You HEAD the image first (curl -I) to get the size of it (Content-Length:),
and if it seems reasonable, get it for real.
-- Daniel Stenberg - http://www.contactor.se/~dast - +46-705-44 31 77 ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`olReceived on 2000-05-25