Namespace: ITHit.WebDAV.Client
Task UploadAsync( string filename, LockUriTokenPair[] lockTokens = null, IDictionary<string, string> headers = null, CancellationToken cancellationToken = null )
[Missing <returns> documentation for "M:ITHit.WebDAV.Client.IItemContent.UploadAsync(System.String,ITHit.WebDAV.Client.LockUriTokenPair[],System.Collections.Generic.IDictionary{System.String,System.String},System.Threading.CancellationToken)"]
Exception | Condition |
---|---|
NotFoundException | This resource doesn't exist on the server. |
ConflictException | The resource is version controlled and has to be checked out to be edited. |
WebDavHttpException | Server returned unknown error. |
WebDavException | Unexpected error occurred. |
IOException | An I/O error occurs. |
ArgumentOutOfRangeException | File is empty. |
string license = "<?xml version='1.0' encoding='utf... WebDavSessionAsync session = new WebDavSessionAsync(license); session.Credentials = new NetworkCredential("User1", "pwd"); IFolder folder = await session.GetFolderAsync(new Uri("https://server:8080/Sales")); IFile file = await folder.CreateFileAsync("products.xlsx"); file.AllowWriteStreamBuffering = false; file.TimeOut = 36000000; // 10 hours await file.UploadAsync("C:\\products.xlsx");