menu

Blazor

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

    Show / Hide Table of Contents

    Class FileInfo

    Provides comprehensive information about the selected files' details in the SfUploader component.

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

    This class encapsulates all essential information about a file selected for upload, including metadata such as name, size, type, and status information. It serves as the primary data structure for tracking file information throughout the upload lifecycle, from selection through completion or failure.

    Constructors

    FileInfo()

    Declaration
    public FileInfo()

    Properties

    FileSource

    Gets or sets the file path of the selected file as specified by the browser.

    Declaration
    public string FileSource { get; set; }
    Property Value
    Type Description
    System.String

    A string representing the file path, or null if the path is not available.

    Remarks

    This property contains the browser-provided file path information. Note that for security reasons, modern browsers may not provide the complete file system path, and this value should not be relied upon for file system operations.

    Id

    Gets or sets the unique identifier of the file as generated by the uploader component.

    Declaration
    public string Id { get; set; }
    Property Value
    Type Description
    System.String

    A string containing the unique file identifier, or null if no ID has been assigned.

    Remarks

    This property provides a unique identifier for the file within the context of the uploader component. It is useful for tracking files throughout their lifecycle and for associating events with specific files.

    Input

    Gets or sets the input element associated with this file list item.

    Declaration
    public DOM Input { get; set; }
    Property Value
    Type Description
    DOM

    A DOM object representing the input element, or null if no input element is associated.

    Remarks

    This property provides access to the DOM input element that was used to select this file, allowing for direct manipulation of the input element if needed.

    LastModifiedDate

    Gets or sets the last modified date of the file as reported by the browser.

    Declaration
    public DateTime LastModifiedDate { get; set; }
    Property Value
    Type Description
    System.DateTime

    A System.DateTime value representing when the file was last modified.

    Remarks

    This property contains the timestamp of when the file was last modified on the user's file system. This information can be useful for file versioning, synchronization scenarios, or providing additional context about the file to users.

    List

    Gets or sets the list item element that represents this file in the file list UI.

    Declaration
    public DOM List { get; set; }
    Property Value
    Type Description
    DOM

    A DOM object representing the list item element, or null if no list element exists.

    Remarks

    This property provides access to the DOM element that displays this file in the uploader's file list, enabling custom styling or manipulation of the file's visual representation.

    MimeContentType

    Gets or sets the MIME content type of the file as specified by the browser.

    Declaration
    public string MimeContentType { get; set; }
    Property Value
    Type Description
    System.String

    A string representing the MIME content type, or null if the content type is not available.

    Remarks

    This property provides an alternative or additional MIME type specification for the file. It may contain more specific content type information or serve as a fallback when the primary Type property is not available.

    Name

    Gets or sets the name of the file as specified by the browser.

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    System.String

    A string containing the file name including extension, or null if the name is not available.

    Remarks

    This property contains the original filename as provided by the browser, including the file extension. It represents the name of the file as it exists on the user's file system.

    RawFile

    Gets or sets the raw file object containing the complete file data and metadata.

    Declaration
    public object RawFile { get; set; }
    Property Value
    Type Description
    System.Object

    An object containing the raw file data and browser-provided metadata, or null if no raw file data is available.

    Remarks

    This property provides access to the underlying browser File object that contains the actual file content and additional metadata. It can be used for advanced file processing scenarios where direct access to the file content is required.

    Size

    Gets or sets the size of the file in bytes as reported by the browser.

    Declaration
    public double Size { get; set; }
    Property Value
    Type Description
    System.Double

    A double value representing the file size in bytes.

    Remarks

    This property contains the file size as determined by the browser. It is useful for validation, progress tracking, and displaying file information to users. The size is measured in bytes and can be used to enforce file size limits.

    Status

    Gets or sets the current status of the file in the upload process.

    Declaration
    public string Status { get; set; }
    Property Value
    Type Description
    System.String

    A string describing the current file status, or null if no status is available.

    Remarks

    This property indicates the current state of the file within the upload process. It provides human-readable status information that can be displayed to users to inform them of the file's current state in the upload workflow.

    StatusCode

    Gets or sets the current state code of the file in the upload lifecycle.

    Declaration
    public string StatusCode { get; set; }
    Property Value
    Type Description
    System.String

    A string representing the status code such as "Failed", "Canceled", "Selected", "Uploaded", or "Uploading", or null if no status code is set.

    Remarks

    This property provides a standardized status code that represents the file's current state in the upload process. Common values include:

    • Selected - File has been selected but not yet uploaded
    • Uploading - File upload is currently in progress
    • Uploaded - File has been successfully uploaded
    • Failed - File upload has failed
    • Canceled - File upload has been canceled

    Type

    Gets or sets the MIME type of the file as determined by the browser.

    Declaration
    public string Type { get; set; }
    Property Value
    Type Description
    System.String

    A string representing the MIME type (e.g., "image/jpeg", "application/pdf"), or null if the type cannot be determined.

    Remarks

    This property contains the MIME type of the file as determined by the browser based on the file extension and content. If the browser cannot determine the file type, this property may be null or an empty string. This information is useful for file type validation and processing decisions.

    ValidationMessages

    Gets or sets the validation error messages associated with this file.

    Declaration
    public ValidationMessages ValidationMessages { get; set; }
    Property Value
    Type Description
    ValidationMessages

    A ValidationMessages object containing validation error messages, or null if no validation errors exist.

    Remarks

    This property contains validation error messages that are generated when the file fails to meet the specified validation criteria, such as file size limits or allowed file type restrictions. These messages can be displayed to users to help them understand why a file was rejected.

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