Class AssistViewAttachmentSettings
Represents configuration settings for attachments in the SfAIAssistView component.
Inheritance
Namespace: Syncfusion.Blazor.InteractiveChat
Assembly: Syncfusion.Blazor.dll
Syntax
public class AssistViewAttachmentSettings : Object
Remarks
The AssistViewAttachmentSettings class provides attributes to manage attachment behavior, including URLs for saving and removing files, allowed file types, and maximum file size constraints.
- Enable - Enables the file attachments
- SaveUrl - URL to save files
- RemoveUrl - URL to remove files
- AllowedFileTypes - File types allowed for upload
- MaxFileSize - Maximum file size in bytes
Examples
Configuring attachment settings:
var attachmentSettings = new AssistViewAttachmentSettings
{
Enable = true,
SaveUrl = "https://myserver.com/api/Save",
RemoveUrl = "https://myserver.com/api/Remove",
AllowedFileTypes = ".jpg,.png,.pdf",
MaxFileSize = 5000000 // 5 MB
};
Constructors
AssistViewAttachmentSettings()
Declaration
public AssistViewAttachmentSettings()
Properties
AllowedFileTypes
Gets or sets the allowed file types that can be attached in the SfAIAssistView component.
Declaration
public string AllowedFileTypes { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the comma-separated list of allowed file types. The default value is System.String.Empty. |
Remarks
Use this property to specify which file types are acceptable for attachment, using file extensions like ".jpg"
, ".png"
, etc.
Enable
Gets or sets a value indicating whether attachments are enabled in the SfAIAssistView component.
Declaration
public bool Enable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | A System.Boolean indicating whether attachments are enabled. The default value is false. |
Remarks
This property allows enabling or disabling attachments within the SfAIAssistView component. When set to true, users can attach files to their prompts.
Consider enabling attachments only when necessary to prevent unnecessary data exchange.
MaxFileSize
Gets or sets the maximum file size allowed for attachments in the SfAIAssistView component.
Declaration
public double MaxFileSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double representing the maximum file size in bytes. The default value is |
Remarks
This property sets a limit on the size of a single attachment. Files that exceed this size will be rejected and not processed for upload.
RemoveUrl
Gets or sets the URL from which files can be removed when detached in the SfAIAssistView component.
Declaration
public string RemoveUrl { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the URL for removing files. The default value is System.String.Empty. |
Remarks
This property should be configured to point to a server-side endpoint that handles file remove requests.
SaveUrl
Gets or sets the URL to which files are saved when attached in the SfAIAssistView component.
Declaration
public string SaveUrl { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the URL for saving files. The default value is System.String.Empty. |
Remarks
This property should be configured to point to a server-side endpoint where files will be saved upon uploading.