range.d 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. c: Copyright (C) 1998 - 2022, Daniel Stenberg, <[email protected]>, 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. ---
  13. Retrieve a byte range (i.e. a partial document) from an HTTP/1.1, FTP or SFTP
  14. server or a local FILE. Ranges can be specified in a number of ways.
  15. .RS
  16. .TP 10
  17. .B 0-499
  18. specifies the first 500 bytes
  19. .TP
  20. .B 500-999
  21. specifies the second 500 bytes
  22. .TP
  23. .B -500
  24. specifies the last 500 bytes
  25. .TP
  26. .B 9500-
  27. specifies the bytes from offset 9500 and forward
  28. .TP
  29. .B 0-0,-1
  30. specifies the first and last byte only(*)(HTTP)
  31. .TP
  32. .B 100-199,500-599
  33. specifies two separate 100-byte ranges(*) (HTTP)
  34. .RE
  35. .IP
  36. (*) = NOTE that this will cause the server to reply with a multipart
  37. response, which will be returned as-is by curl! Parsing or otherwise
  38. transforming this response is the responsibility of the caller.
  39. Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the
  40. 'start-stop' range syntax. If a non-digit character is given in the range,
  41. the server's response will be unspecified, depending on the server's
  42. configuration.
  43. You should also be aware that many HTTP/1.1 servers do not have this feature
  44. enabled, so that when you attempt to get a range, you will instead get the
  45. whole document.
  46. FTP and SFTP range downloads only support the simple 'start-stop' syntax
  47. (optionally with one of the numbers omitted). FTP use depends on the extended
  48. FTP command SIZE.
  49. If this option is used several times, the last one will be used.