cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP PUT resume

From: <tom_waters_at_mac.com>
Date: Tue, 5 Mar 2002 10:34:56 -0800

seeking worked. you automagically figure out the right adjustment to
content-length...

        mPutFile = fopen(mPath, "r");
        fseek(mPutFile, 0, SEEK_END);
        curl_easy_setopt(mCURL, CURLOPT_PUT, 1L);
        curl_easy_setopt(mCURL, CURLOPT_INFILE, mPutFile);
        curl_easy_setopt(mCURL, CURLOPT_INFILESIZE, ftell(mPutFile));
        fseek(mPutFile, offset, SEEK_SET);

On Tuesday, March 5, 2002, at 04:23 AM, Daniel Stenberg wrote:

> On Tue, 5 Mar 2002 tom_waters_at_mac.com wrote:
>
>> I have read that HTTP puts with Content-Range works... but I'm not
>> getting
>> there with my usage of it.
>
> Ah, right. I remember us working with that, but not exactly how things
> ended
> up...
>
> I'll try to fill in what I seem to recall. This reeaaaaaally needs to be
> documented so if we can just make it work now, we should write it all
> down in
> big block letters somewhere.
>
>> Do I have to seek the FILE * that I'm putting to the offset I want to
>> start
>> the put at?
>
> I think you do, yes.
>
>> And what do I set in CURLOPT_INFILESIZE? the actual size of the
>> file? or
>> the size of the partial segment i want to put?
>
> I believe you should set that size to the size you want to upload, that
> is
> the size of the segment you want to put.
>
>> got any example code?
>
> Unfortunately not. If you would produce one example source code to try
> this
> out, we could indeed put that in the example dir when it works!
>
> --
> Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
>
Received on 2002-03-05