Click or drag to resize

IHierarchyItemRefreshAsync Method

IT Hit WebDAV Classes Reference
Rereads item properties from server.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 5.1.2712
Syntax
Task RefreshAsync()

Task RefreshAsync()

Return Value

Type: Task

[Missing <returns> documentation for "M:ITHit.WebDAV.Client.IHierarchyItem.RefreshAsync"]

Remarks
Use this method after uploading item content or after any methods that modify item state on server.
Examples
The following example demonstrates how to upload a file from local file system to a WebDAV server and that read file length from server.
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 davFile = await folder.CreateFileAsync("products.xlsx");
await davFile.UploadAsync("C:\\products.xlsx");
await davFile.RefreshAsync(); // ContentLength property becomes invalid after item content update, reread it from server
Console.WriteLine(davFile.ContentLength);
See Also