curl-library
Re: Progress During Posts
Date: Tue, 12 Nov 2002 22:13:34 -0800
Thanks! This is helpful.
I did solve the problem -- it was a programming error on my part. Funny
how you always find those bugs just after sending out a plea for help :-/.
Anyhow, thanks again.
Miles
Traxler Bence wrote:
>Hi,
>
>I had the same problem a month ago and I don't remember what was wrong
>:) but now it's working with this:
>
>void setFilePost(wxString id, wxArrayString* filenames, wxGauge* gauge)
>{
>[...]
>
> //Add files
> for (int i = 0; i < (int)filenames->GetCount(); i++)
> {
> curl_formadd(&form, &last, CURLFORM_COPYNAME, "files[]",
> CURLFORM_FILE, filenames->Item(i).c_str(),
>CURLFORM_END);
> }
>
> [... setting other from fields ... ]
>
> //Set curl options
> curl_easy_setopt(curl, CURLOPT_HTTPPOST, form);
> curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
> curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION,
>progressUpdater);
> curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, gauge);
>
> [...]
>}
>
>int progressUpdater(wxGauge* gauge, double dltotal, double dlnow, double
>ultotal, double ulnow)
>{
> gauge->SetValue(gauge->GetValue() + (int)((double)(ulnow * 100)
>/
>(double)ultotal));
> ::wxYield();
> return 0;
>}
>
>Miles Clark wrote:
>
>
>>Hello All -
>>
>>Does the CURLOPT_PROGRESSFUNCTION callback work for normal HTTP Posts?
>> I'm doing posts with large field values (sometimes uploading a file
>>
>>
>via
>
>
>>HTTP Post), and I can get the libcurl to call my callback function,
>>
>>
>but
>
>
>>the values are *always* 0 for both upload and download stats.
>>
>>I've tried both "normal" posts and multipart posts, set the
>>POSTFIELDSIZE option directly, etc. -- with no luck.
>>
>>Any ideas?
>>
>>thanks in advance!
>>
>>Miles
>>
>>
>>
>
>
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:
>To learn the basics of securing your web site with SSL,
>click here to get a FREE TRIAL of a Thawte Server Certificate:
>http://www.gothawte.com/rd522.html
>
>
>
-------------------------------------------------------
This sf.net email is sponsored by: Are you worried about
your web server security? Click here for a FREE Thawte
Apache SSL Guide and answer your Apache SSL security
needs: http://www.gothawte.com/rd523.html
Received on 2002-11-13