2016-09-26 10 views
0

私は初心者です。私はバイト提供のための範囲要求を勉強してきました。バイト734-1233/1234最後のバイト範囲の最後のバイトのHTTP範囲要求

:私は、そのサーバがこの

のContent-レンジなどからバイト範囲を送信するために持っていました。しかし、リクエスト自体が最後まで1バイトであるときに、ブラウザはファイルの最後のバイトをどのように取得するでしょうか?

リンク私が言及してきた:https://greenbytes.de/tech/webdav/draft-ietf-httpbis-p5-range-latest.html

答えて

0

現在の標準はRFC 7233です。 2.1 Byte Rangesから:4.2 Content-Rangeの例にこれを適用する

The first-byte-pos value in a byte-range-spec gives the byte-offset 
of the first byte in a range. The last-byte-pos value gives the 
byte-offset of the last byte in the range; that is, the byte 
positions specified are inclusive. Byte offsets start at zero. 

The following are examples of Content-Range values in which the 
selected representation contains a total of 1234 bytes: 

o The first 500 bytes: 

    Content-Range: bytes 0-499/1234 

範囲はゼロベースであるため、0が最初のバイトであり、499が500番目です。したがって、1233は1234バイトの文書の最後のバイトです。

+1

ありがとうございます。したがって、Content-Lengthはファイルの実際のサイズです。 – Prajwal

関連する問題