Curl ignores the -r switch when -C is present

0

I wanted to download a part of a file. (Let's say http://mysite.com/myfile.zip)
So I used this command:

curl -r 200000-400000 -O http://mysite.com/myfile.zip

Unfortunately my Internet connection was dropped in the middle of downloading.
However, 1MB was downloaded so far. I've 3MB more to go.

So I used this command, to download the file, from where it was left off:

curl -r 200000-400000 -C - -O http://mysite.com/myfile.zip

The download resumes form the 3rd megabyte, but the problem is it doesn't end with 4th. Curl exceeds the range I specified, and continues to download the entire file. Why is this happening? Any help is appreciated!

(Actually, the file I'm downloading is a huge one. It's supposed to download over night. I want to avoid downloading what I already have, to save the bandwidth. I have to do this with several files. So I'm seeking for fix which is independent from the file's unique properties.)

Naveen

Posted 2013-06-13T11:28:43.830

Reputation: 101

I have tried to reproduce your results, and for me it worked. Can you share more information about your OS and the version of curl you are using? curl -V will provide good info. – Squeezy – 2013-06-13T16:58:11.777

Thanks for the reply. I'm using Curl 7.29.0 on Ubuntu 13.04 64bit. – Naveen – 2013-06-18T06:21:42.100

No answers