Skip to main content
All docs
V26.1
  • AIChatControl.OptionsFileUpload Property

    Gets file upload settings, such as the maximum file size, allowed file types and extensions, and the maximum number of files a user can attach to a message.

    Namespace: DevExpress.AIIntegration.WinForms.Chat

    Assembly: DevExpress.AIIntegration.WinForms.Chat.v26.1.dll

    NuGet Package: DevExpress.AIIntegration.WinForms.Chat

    Declaration

    public OptionsFileUpload OptionsFileUpload { get; }

    Property Value

    Type Description
    DevExpress.AIIntegration.WinForms.Chat.OptionsFileUpload

    An object that contains file upload settings.

    Remarks

    Users can attach files directly to their chat messages. The AI analyzes document content (such as text files, PDFs, images) and delivers more context-aware responses.

    File Upload - WinForms AI Chat Control, DevExpress

    Run Demo: AI Chat – File Attachments

    To activate file upload:

    1. Enable the FileUploadEnabled property to allow users to attach files.
    2. Use OptionsFileUpload settings to configure file upload operations based on your project requirements:

      Setting Description
      FileTypeFilter A collection of allowed MIME types.
      AllowedFileExtensions A collection of allowed file extensions.
      MaxFileCount The maximum number of files a user can attach to a message.
      MaxFileSize The maximum file size (in bytes).

    Example

    aiChatControl1.FileUploadEnabled = DevExpress.Utils.DefaultBoolean.True;
    aiChatControl1.OptionsFileUpload.FileTypeFilter.AddRange(new List<string> { "text/plain", "application/pdf", "image/png" }); // Allowed MIME types.
    aiChatControl1.OptionsFileUpload.AllowedFileExtensions.AddRange(new List<string> { ".txt", ".pdf", ".png" });
    aiChatControl1.OptionsFileUpload.MaxFileCount = 5;
    aiChatControl1.OptionsFileUpload.MaxFileSize = 5 * 1024 * 1024; // 5 MB
    

    Tip

    See the following article for more information on MIME types (FileTypeFilter): Common Media Types.

    Refer to the following help topic for additional information: AI Chat Control

    See Also