Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

FileSystemItem.Size Property

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

Namespace: DevExtreme.AspNet.Mvc.FileManagement

Assembly: DevExtreme.AspNet.Core.dll

#Declaration

C#
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