cURL / Mailing Lists / curl-library / Single Mail

curl-library

Curl Issue..........

From: Sumukh Anantha Manohar <am.sumukh_at_gmail.com>
Date: Thu, 21 Jul 2011 10:53:59 +0530

Hi,
I am trying to download files whose size is greater than 2GB using curl
API's like curl_easy_perform ( ) and curl_easy_setopt ( ) on linux and unix
platforms using c++ language.

The problem is, the above functions are helping me to download upto 2GB file
size and not more than that.
Here what i am doing is................I am calling the statement:

curl_easy_setopt(curlHandle_m, CURLOPT_WRITEFUNCTION,
FileTransfer::CallBack);

Then, it calls the CallBack function which tries to download the file part
by part in bytes into the destination place.But once the file reaches 2GB
size it is not able to write the remaining data into the file.

Following is the Callback function:

size_t FileTransfer::CallBack(void *buffer, size_t size, size_t nmemb, void
*stream) {

struct DownloadFileName *out = (struct DownloadFileName *) stream;
if (out && !out->stream) {

LOG_DEBUG(ACE_TEXT("While downloading file name as: %s\n"), out->filename);

// open file for writing
out->stream = ACE_OS::fopen(out->filename, "wb");

if (!out->stream) {

  // Failure, can't open file to write
  return CURLE_WRITE_ERROR;
}
}
  return ACE_OS::fwrite(buffer, size, nmemb, out->stream);
}

So plz anyone help me regarding this issue......

Thanks,

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-07-21