cURL / Mailing Lists / curl-library / Single Mail

curl-library

Progress During Large Posts

From: Dan Petitt <dan_at_digiguide.com>
Date: Thu, 13 Mar 2008 11:28:07 -0000

Hi
 
I am trying to 'post' a very large string (not a file from disk) to the
server and wish to have some progress feedback on this 'upload' but the
progress only gives me information on the subsequent response back and not
the actual upload.
 
Is this a limitation? If not, can someone give me the right info to set this
up. This is what I am doing (briefly):

curl_easy_setopt( curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback );

curl_easy_setopt( curl, CURLOPT_CONNECTTIMEOUT,
pThread->m_pRequester->GetConnectionTimeout() );
curl_easy_setopt( curl, CURLOPT_TIMEOUT,
pThread->m_pRequester->GetDownloadTimeout() * 10 );

curl_easy_setopt( curl, CURLOPT_NOPROGRESS, FALSE );
curl_easy_setopt( curl, CURLOPT_PROGRESSFUNCTION, ProgressCallback );

curl_easy_setopt( curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );

curl_easy_setopt( curl, CURLOPT_URL, fa.m_strURL );
curl_easy_setopt( curl, CURLOPT_WRITEDATA , (void *)&fa );

curl_easy_setopt( curl, CURLOPT_HEADER, 0 );

curl_easy_setopt( curl, CURLOPT_POST, TRUE );
curl_easy_setopt( curl, CURLOPT_POSTFIELDS, fa.m_arrPOSTData.GetData() );
curl_easy_setopt( curl, CURLOPT_POSTFIELDSIZE, fa.m_arrPOSTData.GetSize() );

curl_easy_setopt( curl, CURLOPT_USERAGENT, strAgent );
CURLcode code = curl_easy_perform( curl );
....

Thanks
Dan
Received on 2008-03-13