Skip to main content
A newer version of this page is available. .

FileSystemItem.Size Property

Specifies a file system item’s size, in bytes.

Namespace: DevExtreme.AspNet.Mvc.FileManagement

Assembly: DevExtreme.AspNet.Core.dll

Declaration

public long Size { get; set; }

Property Value

Type Description
Int64

The size.

Remarks

In the following example, the FileManager uses a custom file system provider to manage files and folders in Microsoft Azure Blob Storage. The Size property allows you to specify size for each file system item inside the GetItems(FileSystemLoadItemOptions) method. Refer to the FileManager - Azure Server-Side Binding online demo to see the whole code.

File system provider:

public IEnumerable<FileSystemItem> GetItems(FileSystemLoadItemOptions options) {
    var result = new List<FileSystemItem>();
    foreach(IListBlobItem blob in Results) {
        ...
        var item = new FileSystemItem();
        if(blob is CloudBlob) {
            var blockBlob = (CloudBlob)blob;
            item.Name = name;
            item.DateModified = blockBlob.Properties.LastModified.GetValueOrDefault().DateTime;
            item.Size = blockBlob.Properties.Length;
            ...
        }
        result.Add(item);
    }
}

Concepts

Online Demo

See Also