Enabling attaching files to an application
Enable application users to attach files to a desktop, mobile, or an offline-enabled application by adding the Attach content control (pxAttachContent).Users can add files to an application by using either the file browser or the drag-and-drop functionality. You can choose to display this control as a button, a link, or an icon.
The Attach content control is also supported in offline-enabled applications. For more information, see Attach content support in offline mode.
On the Design tab, from the Action list, drag Attach content onto the work area.
Click the View properties icon for the control.
In the Cell Properties window, next to the control name, click Change, and then select Attachments.
On the General tab, configure the following settings:
- Display options for the control.
- In the Displayed as list, specify whether to display the control as a button, link or icon.
- In the Button caption list, specify the button caption as text or a property reference.
- In the Text field, enter a label for the control.
- In the Image source list, specify image source to be a simple image, property, icon class, or none.
- In the Helper text list, specify whether to display a tooltip.
- In the Visibility list, specify whether to always display the control, or only based on an expression or a when rule.
- In the Disable list, specify whether to never or always disable the control, or only disable based on an expression or a when rule.
- Attachment settings for the control.
- In the File name list, specify whether to use the default file name, or based on a property reference or text.
- In the Category list, specify a category or one based on property reference.
- In the Attach to list, specify whether to attach to a work item or a page.
- Attachment compression parameters for mobile apps. For more information, see Configuring file size options for the Attach content control.
- Display options for the control.
At run time, users can attach files to cases according to the following scenarios:
- In a desktop application, users can attach files to their application in the default file browser window.
- In a Pega Client for a Windows-based application, when a camera is present in the device, a selection dialog box with two options opens. Users can open the native file picker component to attach files to their application or open a live camera view to take a snapshot. When a user takes a picture, the control creates a file with a timestamp-based file name and attaches the file to the application. If no camera is available, the control opens the native file picker component without displaying the selection dialog box.
- In a mobile app, users can select a file of any type from the device storage, or from any mobile app that is installed on the device, for example, Dropbox, Google Drive, iCloud, Audio Recorder or Camera. In addition, you can configure compression parameters to limit the size of files that are created on a mobile device. The Attach content control also supports sharing file attachments with external mobile apps, except for signature files.
- Configuring file size options for the Attach content control
To limit the size of files that the user attaches to a mobile app, for example to conserve bandwidth during synchronization, you can configure attachment compression parameters, such as video clip format, video clip duration, maximum image size, and maximum image quality.
- Customizing how the Attach content control is displayed
After you configure a control in a section or a layout to support attaching content, you can customize how the control is displayed to application users.