range.d 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  2. SPDX-License-Identifier: curl
  3. Long: range
  4. Short: r
  5. Help: Retrieve only the bytes within RANGE
  6. Arg: <range>
  7. Protocols: HTTP FTP SFTP FILE
  8. Category: http ftp sftp file
  9. Example: --range 22-44 $URL
  10. Added: 4.0
  11. See-also: continue-at append
  12. Multi: single
  13. ---
  14. Retrieve a byte range (i.e. a partial document) from an HTTP/1.1, FTP or SFTP
  15. server or a local FILE. Ranges can be specified in a number of ways.
  16. .RS
  17. .TP 10
  18. .B 0-499
  19. specifies the first 500 bytes
  20. .TP
  21. .B 500-999
  22. specifies the second 500 bytes
  23. .TP
  24. .B -500
  25. specifies the last 500 bytes
  26. .TP
  27. .B 9500-
  28. specifies the bytes from offset 9500 and forward
  29. .TP
  30. .B 0-0,-1
  31. specifies the first and last byte only(*)(HTTP)
  32. .TP
  33. .B 100-199,500-599
  34. specifies two separate 100-byte ranges(*) (HTTP)
  35. .RE
  36. .IP
  37. (*) = NOTE that this will cause the server to reply with a multipart
  38. response, which will be returned as-is by curl! Parsing or otherwise
  39. transforming this response is the responsibility of the caller.
  40. Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the
  41. 'start-stop' range syntax. If a non-digit character is given in the range,
  42. the server's response will be unspecified, depending on the server's
  43. configuration.
  44. You should also be aware that many HTTP/1.1 servers do not have this feature
  45. enabled, so that when you attempt to get a range, you will instead get the
  46. whole document.
  47. FTP and SFTP range downloads only support the simple 'start-stop' syntax
  48. (optionally with one of the numbers omitted). FTP use depends on the extended
  49. FTP command SIZE.