cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: curl partial HTTP request

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 24 Mar 2008 22:21:01 +0100 (CET)

On Mon, 24 Mar 2008, Shailesh N. Humbad wrote:

> Is it possible to make a partial HTTP request using Curl? This is when
> making an HTTP GET request a server that does not support the HTTP range
> option and does not return the file size in the HTTP headers, so the range
> and max-filesize options won't work.
>
> With fopen/fread, I can read a fixed number of bytes from the request and
> then close the file handle. I want to accomplish the same thing with curl,
> but can't find an option to do that. The option would allow me to read only
> up to X bytes from the response, and then forcibly close the connection.

I think the PHP binding to libcurl supports the write callback, and if that
resembles the "real" libcurl's function it can abort the download at any point
it deems necessary.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-03-24