blazor-devexpress-dot-aiintegration-dot-blazor-dot-chat-dot-dxaichat-3b55d175.md
Specifies whether users can attach files to messages.
Namespace : DevExpress.AIIntegration.Blazor.Chat
Assembly : DevExpress.AIIntegration.Blazor.Chat.v25.2.dll
NuGet Package : DevExpress.AIIntegration.Blazor.Chat
[Parameter]
public bool FileUploadEnabled { get; set; }
| Type | Description |
|---|---|
| Boolean |
true to enable file upload operations; otherwise, false.
|
Blazor AI Chat allows users to attach files when sending messages to the chat. Set the DxAIChat.FileUploadEnabled property to true to enable file upload operations.
Once a user attaches files to a message, the AI Chat component validates uploaded files. To configure validation rules, declare a DxAIChatFileUploadSettings object in AIChatSettings component markup and specify the following properties:
AllowedFileExtensionsSpecifies file extensions the AI Chat component can upload.MaxFileCountSpecifies the maximum number of files that users can attach to a message.MaxFileSizeSpecifies the maximum file size in bytes.
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