Skip to main content

FileAttachmentSettings

Namespace: Wisej.Web.Ext.Syncfusion2

Assembly: Wisej.Web.Ext.Syncfusion2 (4.1.0.0)

Configures Syncfusion attachment upload behavior and templates for the chat composer.

public class FileAttachmentSettings

Constructors​

Instance member FileAttachmentSettings()​

Initializes a new instance of FileAttachmentSettings.

Properties​

Instance member AllowedFileTypes​

String: Gets or sets the allowed attachment extensions. (Default: null)

The value is passed to the Syncfusion allowedFileTypes option: a comma-separated list of file extensions, each with the leading dot. All file types are allowed when the value is empty.

Example:

The following example restricts the attachments to images and PDF documents.

chat.EnableAttachments = true;
chat.AttachmentSettings = new Chat.FileAttachmentSettings
{
AllowedFileTypes = ".png,.jpg,.pdf"
};

Instance member AttachmentTemplate​

String: Gets or sets the template used to render footer attachments. (Default: null)

Instance member EnableDragAndDrop​

Boolean: Gets or sets whether drag-and-drop uploads are enabled. (Default: True)

Instance member MaxFileSize​

Double: Gets or sets the maximum upload size in bytes. (Default: 30000000)

Instance member MaximumCount​

Int32: Gets or sets the maximum number of attachments allowed per message. (Default: 10)

Instance member Path​

String: Gets or sets the storage path used for uploaded files. (Default: null)

The upload service built into the Chat control saves the uploaded files in this folder, and removes them from it. A relative path is resolved against the application folder; when the value is empty the files are stored in a subfolder of the temporary folder of the system. The folder is created when it does not exist. A file with the name of an existing file is saved with a numeric suffix (name_1.ext, name_2.ext, ...).

The value is also passed to the widget as the Syncfusion path option.

Example:

The following example stores the uploaded files in a folder of the application.

chat.EnableAttachments = true;
chat.AttachmentSettings = new Chat.FileAttachmentSettings
{
Path = "App_Data/ChatUploads"
};

Instance member PreviewTemplate​

String: Gets or sets the template used to render attachment previews. (Default: null)

Instance member RemoveUrl​

String: Gets or sets the remove endpoint used by the built-in uploader. (Default: null)

When the value is empty at the time the settings are assigned to AttachmentSettings, it is set to the URL of the upload service built into the Chat control, which deletes the removed file from Path. Set the URL of your own service to handle the removal elsewhere.

Instance member SaveFormat​

SaveFormat: Gets or sets the format used to persist uploaded content. (Default: Blob)

Instance member SaveUrl​

String: Gets or sets the save endpoint used by the built-in uploader. (Default: null)

When the value is empty at the time the settings are assigned to AttachmentSettings, it is set to the URL of the upload service built into the Chat control, which saves the uploaded files in Path. Set the URL of your own service to store the files elsewhere.