DxAIChat.FileUploadEnabled Property
Specifies whether users can attach files to messages.
Namespace: DevExpress.AIIntegration.Blazor.Chat
Assembly: DevExpress.AIIntegration.Blazor.Chat.v25.1.dll
NuGet Package: DevExpress.AIIntegration.Blazor.Chat
Declaration
[Parameter]
public bool FileUploadEnabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
Remarks
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:
- AllowedFileExtensions
- Specifies file extensions the AI Chat component can upload.
- MaxFileCount
- Specifies the maximum number of files that users can attach to a message.
- MaxFileSize
- Specifies the maximum file size in bytes.
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>