Click or drag to resize

IResumableUploadWriteStreamAsync Method

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: 6.0.4052-Beta
Task WriteStreamAsync(
	Func<Stream, Task> onStreamAvailable,
	long startIndex,
	long contentLength,
	long resourceTotalSize,
	string contentType = null,
	LockUriTokenPair[] lockTokens = null,
	IDictionary<string, string> headers = null,
	CancellationToken cancellationToken = null


Type: SystemFuncStream, Task
Function to write to request stream.
Type: SystemInt64
Index to the first byte in the file content to be set by the request.
Type: SystemInt64
Length of data to be written.
Type: SystemInt64
Total size of the resource content.
contentType (Optional)
Type: SystemString
Media type of the file.
lockTokens (Optional)
Type: ITHit.WebDAV.ClientLockUriTokenPair
Lock tokens for this file.
headers (Optional)
Type: System.Collections.GenericIDictionaryString, String
Request headers.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
Propagates notification that operations should be canceled.

Return Value

Type: Task

[Missing <returns> documentation for "M:ITHit.WebDAV.Client.IResumableUpload.WriteStreamAsync(System.Func{System.IO.Stream,System.Threading.Tasks.Task},System.Int64,System.Int64,System.Int64,System.String,ITHit.WebDAV.Client.LockUriTokenPair[],System.Collections.Generic.IDictionary{System.String,System.String},System.Threading.CancellationToken)"]

NotFoundExceptionThis resource doesn't exist on the server.
WebDavHttpExceptionServer returned unknown error.
WebDavExceptionUnexpected error occurred.

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 IItemContent.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.IResumableUpload interface on server items.

See Also