Click or drag to resize

IItemContentContentLength Property

IT Hit WebDAV Classes Reference
Length of the file content.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 6.0.4052-Beta
Syntax
long ContentLength { get; }

Property Value

Type: Int64
Length or the file content in bytes.
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