Skip to main content
All docs
V25.1
  • DxAIChatFileUploadSettings.MaxFileCount Property

    Specifies the maximum number of files that users can attach to a message.

    Namespace: DevExpress.AIIntegration.Blazor.Chat

    Assembly: DevExpress.AIIntegration.Blazor.Chat.v25.1.dll

    NuGet Package: DevExpress.AIIntegration.Blazor.Chat

    Declaration

    [Parameter]
    public int MaxFileCount { get; set; }

    Property Value

    Type Description
    Int32

    The maximum number of files.

    Remarks

    Set the FileUploadEnabled property to true to enable file upload operations for users.

    AI Chat - File Attachments

    Once a user attaches a file to a message, the AI Chat component adds this file to the file list. Users can attach multiple files simultaneously. Declare a DxAIChatFileUploadSettings object and use its MaxFileCount property to specify the maximum file list size. When the file list reaches its size limit, the component displays an error message. Users can add new files only after they remove one or more uploaded files.

    Refer to the DxAIChatFileUploadSettings class description for more information.

    Example

    The following code snippet activates the file upload functionality in Blazor AI Chat and configures validation rules for uploaded files:

    @using DevExpress.AIIntegration.Blazor.Chat
    
    <DxAIChat CssClass="demo-chat"
              FileUploadEnabled="true">
        <AIChatSettings>
            <DxAIChatFileUploadSettings MaxFileCount="2"
                                        MaxFileSize="20000"
                                        AllowedFileExtensions="@(new List<string> { ".jpg", ".pdf" })"
                                        FileTypeFilter="@(new List<string> { "image/*", "application/pdf"})" />
        </AIChatSettings>
    </DxAIChat>
    

    Run Demo: AI Chat - File Attachments

    See Also