cURL / Mailing Lists / curl-library / Single Mail


Re: HTTP PUT, and the progress meter

From: Nick Jensen <>
Date: Tue, 8 Jun 2010 19:09:12 -0400

> if I make a PUT request that is "not valid", Amazon will return an XML
>> document saying what went wrong. This is fine, but before I receive that
>> failure response (body/headers), the progress_function is getting called and
>> with the 'ulnow' value > 0. This causes my UI to show that some amount of
>> bytes have been uploaded before it displays the error message that was
>> returned in the response.. In reality though, no bytes were uploaded. Or
>> maybe they were, and just got rejected? Not sure. Either way, my question is
>> how can detect what is "successful" upload progress with an HTTP PUT?
> You simply cannot use the 'ulnow' value of the progress callback as a
> marker for success simply because it grows beyond 0.

So if the 'ulnow' property is not a reliable source of upload progress, is
there some better way I can calculate it? Waiting for the response headers
seems like the only way to determine a success or failure, but at that point
the upload is either completely done or it failed, and the progress function
gets called either way...

List admin:
Received on 2010-06-09