cURL / Mailing Lists / curl-users / Single Mail


The --range option doesn't take effect for my case.

From: Hongyi Zhao <>
Date: Mon, 30 Mar 2015 22:59:28 +0800

Hi developer,

I compiled the latest git version of curl 7.42.0-DEV on Debian Wheezy,
and also learned the following options from its built-in manual page:

       -r, --range <range>
              (HTTP/FTP/SFTP/FILE) Retrieve a byte range (i.e a partial
              ment) from a HTTP/1.1, FTP or SFTP server or a local
              Ranges can be specified in a number of ways.

              0-499 specifies the first 500 bytes

So I try to test this option with the following comands:

1- Firstly, I obtain the length and content type of the target webpage as

werner@debian:~$ curl -I
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 1128131
Content-Type: text/plain; charset=utf-8
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
Set-Cookie: sid=56F3865922CC; expires=Fri, 30-Mar-2018 14:46:59 GMT; path=/
X-Powered-By: ASP.NET
Date: Mon, 30 Mar 2015 14:46:56 GMT

2- Then, I try to obtain the the first 500 bytes for the above webpage:

werner@debian:~$ curl --range 0-499

As you can see, though I use the ` --range 0-499' option, curl still will
download all of the contents of that webpage.

Why does this happen? Any hints?


Hongyi Zhao <>
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493

List admin:
Received on 2015-03-30