Typically, Web servers (such as Apache) turn on support for the continuation of a breakpoint by default. Therefore, if you provide a file download directly through a Web server, you can enjoy the benefits of a breakpoint continuation without having to make a special configuration. A breakpoint continuation is a range header that is added when an HTTP request is initiated to tell the server how many bytes have been downloaded by the client. After all these requests are returned, the resulting content is stitched together to get the complete resource.
You can use the following command to test it.
Whether the Linux test server supports breakpoint continuation
localhost [~]# wget-s http://httpd.apache.org/images/httpd_logo_wide_new.png 2>&1 | grep ' Accept-ranges '
Accept-ranges:bytes
Output Accept-ranges:bytes, indicating that the server supports download by byte.
Curl command send byte range download
Curl–range 0-99 http://images.apple.com/home/images/billboard_iphone_hero.jpg
This can be up to 99 bytes in the beginning, with the results such as:
Description download by byte range from server side is no problem at all.
Now let's try these ways:
1. Download the entire picture at once.
localhost [~]# curl–range 0-98315 http://images.apple.com/home/images/billboard_iphone_hero.jpg > Test.jpg
% total% Received% xferd Average speed Time Time current
Dload Upload Total spent
98316 98316 0 0 524k 0–:–:––:–:––:-:-527k
When finished, test.jpg is exactly equal to billboard_iphone_hero.jpg and the file size is 98,316 bytes.
Note: The byte is starting at 0 and the end byte is the total byte length minus 1.
Does the server support breakpoint continuation