Click or drag to resize

WebDavSessionUploadAsync Method

IT Hit WebDAV Classes Reference
Prepares a request to create or update a file.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 6.0.4052-Beta
Syntax
public Task<string> UploadAsync(
	Uri path,
	Func<Stream, Task> onStreamAvailable,
	string contentType = null,
	long totalContentLength = -1,
	long segmentStartIndex = 0,
	long segmetSize = -1,
	LockUriTokenPair[] lockTokens = null,
	string eTag = null,
	IDictionary<string, string> headers = null,
	CancellationToken cancellationToken = null
)

Parameters

path
Type: SystemUri
File URI.
onStreamAvailable
Type: SystemFuncStream, Task
Function to write to file.
contentType (Optional)
Type: SystemString
Media type of the file.
totalContentLength (Optional)
Type: SystemInt64
Total file content lenth.
segmentStartIndex (Optional)
Type: SystemInt64
Index in file content to start writing from.
segmetSize (Optional)
Type: SystemInt64
Length of content segment to be written.
lockTokens (Optional)
Type: ITHit.WebDAV.ClientLockUriTokenPair
Lock tokens.
eTag (Optional)
Type: SystemString
Server file ETag. Attached to the request to make sure the file changes on the server are not overwritten.
headers (Optional)
Type: System.Collections.GenericIDictionaryString, String
Request headers.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
Propagates notification that operations should be canceled.

Return Value

Type: TaskString
A new ETag for uploaded file.
See Also