Click or drag to resize

IResumableUploadAsyncGetWriteStreamAsync Method (Int64, Int64, Int64)

IT Hit WebDAV Classes Reference
Saves files's partial content to WebDAV server.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 2.0.420.0
Syntax
Task<Stream> GetWriteStreamAsync(
	long startIndex,
	long contentLength,
	long fileTotalSize
)

Parameters

startIndex
Type: SystemInt64
Index to the first byte in the file content to be set by the request.
contentLength
Type: SystemInt64
Length of data to be written.
fileTotalSize
Type: SystemInt64
Total size of the file content.

Return Value

Type: TaskStream
Stream to write file content.
Exceptions
ExceptionCondition
NotFoundExceptionThis resource doesn't exist on the server.
WebDavHttpExceptionServer returned unknown error.
WebDavExceptionUnexpected error occurred.
Remarks

This method issues a PUT request and appends Content-Range header of the form Content-Range: bytes 21010-35145/47022 if necessary.

It will attach Content-Range: bytes XXX-XXX/XXX header only if partial content is submitted. You can always use this method instead of IItemContentAsync.GetWriteStream as Content-Range header is not attached if you upload entire file.

To upload partial content to IT Hit WebDAV Server Engine you must implement ITHit.WebDAV.Server.ResumableUpload.IResumableUploadAsync interface on server items.

See Also