cURL / Mailing Lists / curl-users / Single Mail


Download head of file

From: Oleg Lomaka <>
Date: Sun, 03 Sep 2006 21:09:18 +0300

Hello guys,

I develop a service where users enter an url and script should download
this page to process. But one may enter the url of huge file I don't
want to download. But it is need to view first few kbytes.

For this purpose I've patched curl-7.15.4 to add new parameter

      --max-hard-filesize <bytes>
      Specify the maximum size (in bytes) of a file to store on disk.
      If the file requested is larger than this value, then transfer
      will be terminated and curl returns error 23 (Write error). File
      will be incomplete and takes exactly <bytes> size of space.

I'm doubted it is extremely needed functionality to be added into head cvs. But if you need this you may get the patch here
And here some instructions how to use it.


 Oleg Lomaka,
 oleg.lomaka at gmail dot com,
Received on 2006-09-03