SimpleOne supports attaching files to records. See the Attachments article to learn how to upload, download and delete files attached to a record using the portal or agent interfaces. This article provides information on how to configure various aspects of the system related to attachments:
You can attach files to a field of Image type and a record with the attachment action. The action is displayed on forms as the paper clip icon .
The screenshot below illustrates two attachment actions on the record form:
Attachments can be added via an attachment widget in the agent interface. For this, you need to use the <attachment> SimpleTag within a certain widget instance. It is unnecessary to specify the recordId, tableName attributes for the <attachment> tag located on the page with the form. Therefore, a widget template with an attachment tag will look like this:
<attachment> </attachment> |
After adding a widget instance to a form of the agent interface, the standard action You can add files from the clipboard to the widget directly on the form by using Ctrl+V shortcut while hovering over Drag & drop area. |
When you upload a file, a record is created in the Attachment (sys_attachment) table. To reach these records, navigate to Attachments → All Attachments.
Attachment record form fields
Field | Mandatory | Description |
---|---|---|
Document record | - | Displays the name of the record to which the file is attached. Field type: Document ID. |
File name | + | Specifies the file name. |
File path | - | Specifies the absolute file path on the server. |
Size bytes | - | Defines the file size in bytes. |
MIME content type | + | Specifies the file content type described in the MIME standard. |
Public | - | This attribute displays that this attachment has a permanent link and is available for public access. Refer to the Attachment article to learn more about attachment links. |
Parsing and indexing attachment content is possible only if the attachment file size is under 30 MB. The limit is fixed and cannot be modified. If the file is bigger than 30 MB, it will not be indexed. The warning message related to the indexation is written to logs. You will be able to find more information later in the Main Log (sys_log) table using the criteria below for the filter:
Level IS Warning
Message Contains {Attachment ID}
Indexing is performed only for specific file formats. The Content field on the Attachment form will be automatically filled with the text content of the attached file if the file extension is included in the list: TXT, INI, REG, CVS, JSON, HTM, HTML, DOC, DOCS, XLS, XLSX. The Full text search is enabled within the Content field, which allows you to perform a global search on the field's content.
The attachment parsing and indexing process is asynchronous. Within this process, the following events are implemented:
|
The system logs all operations (except for reading) in the Main Log (sys_log) table. Operations related to attachments have the Source field value equal to Attachment. Navigate to System Logs → Main Log.
If any errors or exceptions were thrown during the attaching process, they can be found in the Exception Log (sys_log_exception) list. Navigate to System Logs → Exception Log.
Refer to the System Audit article to learn more.
To set up attachment properties, complete the following steps:
Edit the Value field.
Click Save or Save and exit to apply the changes.
Property | Description |
---|---|
Maximum number of files that can be uploaded. | |
Maximum file size (in bytes) that can be uploaded. | |
File types that are allowed for uploading. List the extensions separated by commas without spaces, for example, jpeg,png,pdf. Files of other types will be ignored. To allow all types of files, type []. | |
Define system table names in this property, so that attachments within records in the tables do not get indexed. |
Using the Access Control List (ACL), you can restrict operations on Image columns for users with specific roles.
Role required: security_admin.
To restrict access, perform the following steps:
Navigate to System Security → Access Control (ACL).
Click New and fill in the fields.
In the Column field, select the image column you need to secure.
Click Save or Save and exit to apply the changes.
As a result:
The table below describes the effect of the operation restrictions on an image field:
Operation | Description |
---|---|
create | The field is not displayed on a new record form and appears after saving the record. |
read | The field and its contents (attached files) are hidden. |
write | The field is read-only. |
You can supplement the existing access control rules for the Attachments (sys_attachment) table with new rules containing other conditions. New rules should not contradict the existing ones. To do this, complete the steps below:
Navigate to System Security → Access Control (ACL).
Click New and fill in the fields.
In the Table field, select the Attachment table.
Click Save or Save and exit to apply the changes.
See the Access Control articles to learn more about access limitations.