cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Ftp upload resume issuw with very big files.

From: Gisle Vanem <gvanem_at_yahoo.no>
Date: Tue, 26 Aug 2014 16:45:58 +0200

"Daniel Stenberg" <daniel_at_haxx.se> wrote:

> On Tue, 26 Aug 2014, dushyant kumar wrote:
>
>> I am trying to upload a file in a server using libcurl.
>
>> Program works fine for small files (upto 5-6 GB ), however for very big
>> files (more than 10 GB), it continues uploading even after the upload is
>> over (By looking into file size).
>
> According to your screenshots the problems are on Windows and the mistake is
> actually in your code. You use 'struct stat' and stat() which both on Windows
> aren't supporting large files (file sizes above 4GB).

He's not usng the result of stat():
 stat(LOCAL_FILENAME, &buf);

  /*Even tried with this option but no effect*/
  //curl_easy_setopt(curlhandle, CURLOPT_INFILESIZE_LARGE, (curl_off_t)buf.st_size);

I think the problem is elsewhere too. In his main.cpp here:

size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream)
{
  int r;
  unsigned long long len = 0;

  r = sscanf((char*)ptr, "Content-Length: %llu\n", &len);
  if (r)
    *((long *) stream) = len;

Which Windows compiler are you Dushyant using that supports "%llu".
MingW? Another problem AFAICS:

     long resumeFrom = 0;
     curl_easy_setopt(curlhandle, CURLOPT_HEADERDATA, &resumeFrom);

resumeFrom should be 'long long'. And use _fseeki64() too.

--gv
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-08-26