Fragment

Use the Fragment packet to send a fragment of the upload file to the server.

BITS_POST remote-URL HTTP/1.1
BITS-Packet-Type: Fragment
BITS-Session-Id: {guid}
Content-Name: filename
Content-Length: length
Content-Range: Bytes range/total-length
Content-Encoding: encoding

Headers

BITS_POST

BITS-specific verb that identifies this packet to the BITS server.

Replace remote-URL with the absolute or relative URI. Typically, replace remote-URL with the remote file name of the job. For network load balancing considerations, see the BITS-Host-Id header in the Create-Session packet.

BITS-Packet-Type

Identifies this request packet as a Fragment packet.

BITS-Session-Id

String GUID that identifies the session to the server. Replace {guid} with the session identifier that the server returns in the Ack for Create-Session response packet.

Content-Name

Specify this header only with the initial fragment. Replace filename with the name of the local file name from the job. The name does not include the path.

Content-Length

Replace length with the number of bytes sent in the fragment body.

Content-Range

Tells the server where to apply the range in the destination file. Replace range with the start and end offsets of the range in the destination file. The offsets are zero-based. If the given range overlaps an existing range, BITS writes only the non-overlapping portion of the range; BITS does not overwrite existing content. For example, if the first packet contained the range 0 through 100 and the second packet contained the range 50 through 150, BITS writes only bytes 101 through 150 from the second packet. Replace total-length with the total number of bytes in the file.

Content-Encoding

Replace encoding with the type of encoding the client uses on the fragment. The client must use the encoding that the server identifies in the Accept-Encoding header of the Ack for Create-Session response packet. The server uses the encoding type to decode the fragment. All fragments must specify the same encoding.

Do not send this header if the encoding type is Identity. The BITS server supports only Identity encoding.

Remarks

The fragment is a range of bytes sent in the body of the packet. The client sends the fragments in sequential order starting with offset zero; the server does not keep track of non-contiguous ranges. If the client sends non-contiguous ranges, the server returns an HTTP 416 (range-not-satisfiable) return code in the Ack for Fragment response.

The Content-xxxx headers are standard HTTP 1.1 headers. For more details on the Content-xxxx headers, see the RFC 2616 specification.

See also

Ack for Fragment

Close-Session

Create-Session