menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class UploaderFiles - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class UploaderFiles

    Represents a component that specifies the list of files that will be preloaded on rendering of the SfUploader component.

    Inheritance
    System.Object
    UploaderFiles
    Namespace: Syncfusion.Blazor.Inputs
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class UploaderFiles : OwningComponentBase
    Remarks

    The UploaderFiles component allows you to define files that should be displayed as already uploaded when the SfUploader component is initially rendered. This is useful for scenarios where you want to show previously uploaded files or files that exist on the server. The component manages a collection of UploaderUploadedFiles objects that represent the preloaded files.

    Examples

    The following example shows how to use the UploaderFiles component to preload files in an uploader.

    <SfUploader>
        <UploaderFiles>
            <UploaderUploadedFiles Name="document.pdf" Size="1024000" Type="application/pdf"></UploaderUploadedFiles>
            <UploaderUploadedFiles Name="image.jpg" Size="512000" Type="image/jpeg"></UploaderUploadedFiles>
        </UploaderFiles>
    </SfUploader>

    Constructors

    UploaderFiles()

    Declaration
    public UploaderFiles()

    Properties

    Files

    Gets or sets the collection of uploaded files that are preloaded in the SfUploader component.

    Declaration
    public List<UploaderUploadedFiles> Files { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<UploaderUploadedFiles>

    A System.Collections.Generic.List<> of UploaderUploadedFiles objects representing the preloaded files. The default value is an empty list.

    Remarks

    This property contains the list of files that will be displayed as already uploaded when the SfUploader component is rendered. Each file in the collection is represented by an UploaderUploadedFiles object that contains file metadata such as name, size, and type. The files in this collection are automatically added to the uploader's file list during component initialization.

    Examples

    The following example shows how to access and work with the Files collection.

    // Access the files collection
    var uploaderFiles = new UploaderFiles();
    uploaderFiles.Files.Add(new UploaderUploadedFiles 
    { 
        Name = "document.pdf", 
        Size = 1024000, 
        Type = "application/pdf" 
    });

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder

    ComponentDispose(Boolean)

    Releases the unmanaged resources used by the UploaderFiles component and optionally releases the managed resources.

    Declaration
    protected void ComponentDispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    Remarks

    This method is called when the component is being disposed to clean up resources and prevent memory leaks. When disposing is true, the method releases managed resources including clearing the Parent reference and the Files collection. This ensures proper cleanup of component references and prevents potential memory leaks in the application.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved