cabrillo.attachments - Client
-
- UpdatedJan 30, 2025
- 3 minutes to read
- Yokohama
- API reference
The name space for Cabrillo JS attachment functions. This enables adding and viewing attachments.
cabrillo.attachments - addFile(String tableName, String sysId, Object params, String options)
Presents a document picker and uploads the selected file.
Type | Description |
---|---|
promise | If successful a Cabrillo.Attachment object. If the operation fails, an error. |
Example
cabrillo.attachments - addFiles(String tableName, String sysId, Object params, Object options)
Presents a document picker to select and upload files.
Type | Description |
---|---|
Promise | Contains any successfully created attachments and any errors. If multiple files were selected, a Cabrillo.Attachment is created for each successfully uploaded file while an error message is generated for each unsuccessful upload. Data type: Object |
Promise.attachments | Contains any successfully created attachments. Data type: Array |
Promise.errors | Contains any errors. Data type: Array |
Example
This example creates a button for adding multiple attachments to an incident record and checks for any upload errors.
cabrillo.attachments -viewFile(Cabrillo.Attachment attachment, Cabrillo.Rect sourceRect, String sourceBase64Image)
Presents a document picker and uploads the selected file.
Name | Type | Description |
---|---|---|
attachment | Cabrillo.Attachment | Describes the attachment to view. |
sourceRect | Cabrillo.Rect | Optional. Describes the source rectangle of the image to scale up. |
sourceBase64Image | String | Optional. A base64 representation of the source image to scale up. |
Type | Description |
---|---|
promise | If successful, an unresolved object, otherwise an error. |
Example
Example
To scale an image that was tapped into a native image viewer, the viewFile() method accepts optional arguments for the image's rectangle on the page as well as a base64 encoded thumbnail of the image. The thumbnail is scaled into the full size image with an animation.
On this page
- cabrillo.attachments - addFile(String tableName, String sysId, Object params, String
options)
- cabrillo.attachments - addFiles(String tableName, String sysId, Object params, Object options)
- cabrillo.attachments -viewFile(Cabrillo.Attachment attachment, Cabrillo.Rect sourceRect,
String sourceBase64Image)