range.d 1.5 KB

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