Can't you just tell curl to provide that header? Interpreting the
header and returning the appropriate chunk of file, would seem to be
handled by the server, given the interface you describe.
mike
Mark Chandler wrote:
> That's only for file upload.
>
> I have managed to do it directly with another library (by providing the
> header "Range: bytes=x-y") but I have to buy that library.
>
> Would like to see this in libcur but source code is new for me to add
> something like this.
>
> Mark
>
> -----Original Message-----
> From: curlpp-bounces_at_rrette.com [mailto:curlpp-bounces_at_rrette.com] On Behalf
> Of Jean-Philippe Barrette-LaPierre
> Sent: Monday, May 12, 2008 8:44 PM
> To: cURLpp's mailing-list
> Subject: Re: [cURLpp] Seek and read file download
>
> On Monday 12 May 2008 1:23 am, Mark Chandler wrote:
>
>> Well im in need of a http library which will allow me to part download
>> files. Now is there any easy way to use libcur to do this. I would like to
>> be able to use it like fseek and fread for files.
>>
>>
>
> libcURL has those following options:
>
> CURLOPT_SEEKFUNCTION
>
> Function pointer that should match the following prototype: int
> function(void
> *instream, curl_off_t offset, int origin); This function gets called by
> libcurl to seek to a certain position in the input stream and can be used to
>
> fast forward a file in a resumed upload (instead of reading all uploaded
> bytes with the normal read function/callback). It is also called to rewind a
>
> stream when doing a HTTP PUT or POST with a multi-pass authentication
> method.
> The function shall work like "fseek" or "lseek" and accepted SEEK_SET,
> SEEK_CUR and SEEK_END as argument for origin, although (in 7.18.0) libcurl
> only passes SEEK_SET. The callback must return 0 on success as returning
> non-zero will cause the upload operation to fail.
>
> If you forward the input arguments directly to "fseek" or "lseek", note that
>
> the data type for offset is not the same as defined for curl_off_t on many
> systems! (Option added in 7.18.0)
>
> CURLOPT_SEEKDATA
>
> Data pointer to pass to the file read function. If you use the
> CURLOPT_SEEKFUNCTION option, this is the pointer you'll get as input. If you
>
> don't specify a seek callback, NULL is passed. (Option added in 7.18.0)
>
> ----
> Currently, there's no wrapper around those options in cURLpp. I'll try to
> add
> those for the next version. However it shouldn't be there until a month.
>
>
>> Any help (or other librarys that can) would be appreciated.
>>
>>
>>
>> Mark
>>
>
>
--
ÐÏࡱá
_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2008-05-12