cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Seeking functionality during download

From: neha bhagat <nehabhagat.4_at_gmail.com>
Date: Thu, 7 May 2009 15:58:26 +0530

On 5/7/09, centrio_at_gmail.com <centrio_at_gmail.com> wrote:
>
> Hi,
> I want to know if curl has any seeking functionality to seek into a stream
> which is getting downloaded. I found function CURLOPT_SEEKFUNCTION but it
> can be used for uploading only. However for downloading there are some
> options available like CURLOPT_RANGE CURLOPT_RESUME_FROM and
> CURLOPT_RESUME_FROM_LARGE . How can I achienve the seeking functionality
> using this. I want to seek depending upon the offset and the position from
> where the offset begins. Like we have SEEK_SET, SEEK_CUR and SEEK_END in
> seek function, i need similar functionality for download. Please help. Is
> there any direct way to achieve this using libcurl or do i have to create my
> own logic to set proper offset for download depending upon position.?

Hi,

U can use range option........

eg
if you want to seek from offset 5 to 10 ,use
char * range;

strcpy( range ,"5-10")

and then set option using CURLOPT_RANGE
it works for downloads....I have got the results......

Infact I want to upload the file in the same way ......but range option
doesnot work......
If you have got the results please revert......

Regards,
Neha
Received on 2009-05-07