Class UploadedFile
Represents a list of files that are preloaded and displayed in the SfUploader component during initial rendering.
Implements
Inherited Members
Namespace: Syncfusion.Blazor.Toolkit.Inputs
Assembly: Syncfusion.Blazor.Toolkit.dll
Syntax
public class UploadedFile : SfBaseComponent, IAsyncDisposable
Remarks
The UploadedFile class is used to configure files that should appear as already uploaded when the SfUploader component is first rendered. This is useful for scenarios where you need to show existing files that were previously uploaded, allowing users to see and manage them alongside new uploads. Each instance represents a single uploaded file with properties like name, size, and type that define the file's metadata.
Examples
The following example demonstrates how to configure preloaded files in the Uploader component:
<SfUploader>
<UploadedFiles>
<UploadedFile Name="Document1.pdf" Size="2048576" Type="application/pdf" />
<UploadedFile Name="Image1.jpg" Size="1024000" Type="image/jpeg" />
</UploadedFiles>
</SfUploader>
Constructors
UploadedFile()
Declaration
public UploadedFile()
Properties
Name
Gets or sets the name of the uploaded file.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A |
Remarks
This property specifies the display name of the file that will be shown in the SfUploader component. The name should include the file extension to properly identify the file type and provide a meaningful display name to users.
Size
Gets or sets the size of the uploaded file in bytes.
Declaration
public double Size { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | A |
Remarks
This property defines the size of the uploaded file in bytes, which is used by the SfUploader component to display file size information to users. The size is typically displayed in a human-readable format (KB, MB, etc.) in the uploader's file list interface.
Type
Gets or sets the MIME type of the uploaded file.
Declaration
public string Type { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A |
Remarks
This property specifies the MIME type (media type) of the file, which helps identify the file format and content type. Common examples include "image/jpeg" for JPEG images, "application/pdf" for PDF documents, or "text/plain" for text files. The MIME type is used by the SfUploader component for file type validation and display purposes.