Does the server support breakpoint continuation

Source: Internet
Author: User
Tags ranges

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.