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
)
Public Function UploadAsync (
path As Uri,
onStreamAvailable As Func(Of Stream, Task),
Optional contentType As String = Nothing,
Optional totalContentLength As Long = -1,
Optional segmentStartIndex As Long = 0,
Optional segmetSize As Long = -1,
Optional lockTokens As LockUriTokenPair() = Nothing,
Optional eTag As String = Nothing,
Optional headers As IDictionary(Of String, String) = Nothing,
Optional cancellationToken As CancellationToken = Nothing
) As Task(Of String)
public:
Task<String^>^ UploadAsync(
Uri^ path,
Func<Stream^, Task^>^ onStreamAvailable,
String^ contentType = nullptr,
long long totalContentLength = -1,
long long segmentStartIndex = 0,
long long segmetSize = -1,
array<LockUriTokenPair^>^ lockTokens = nullptr,
String^ eTag = nullptr,
IDictionary<String^, String^>^ headers = nullptr,
CancellationToken cancellationToken = nullptr
)
member UploadAsync :
path : Uri *
onStreamAvailable : Func<Stream, Task> *
?contentType : string *
?totalContentLength : int64 *
?segmentStartIndex : int64 *
?segmetSize : int64 *
?lockTokens : LockUriTokenPair[] *
?eTag : string *
?headers : IDictionary<string, string> *
?cancellationToken : CancellationToken
(* Defaults:
let _contentType = defaultArg contentType null
let _totalContentLength = defaultArg totalContentLength -1
let _segmentStartIndex = defaultArg segmentStartIndex 0
let _segmetSize = defaultArg segmetSize -1
let _lockTokens = defaultArg lockTokens null
let _eTag = defaultArg eTag null
let _headers = defaultArg headers null
let _cancellationToken = defaultArg cancellationToken null
*)
-> Task<string>
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:
TaskStringA new ETag for uploaded file.
See Also