Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Attachment FileSize is not Stored



FileSize and pyFileSize properties of the Data-WorkAttach-File class do not store the attachment size.

Error Messages

Not Applicable

Steps to Reproduce


Root Cause

A defect in Pegasystems’ code or rules.


Perform the following local-change:

The application is designed to have attachments in the work-objects adhere to the max-filesize-limit. The size of the uploaded attachment is in the scope of the design. To provide users an extension to store the file size, the properties pyFileSize in Data-WorkAttach-File is created. Following the below steps to store the file size:
  1. Create a Declare Trigger on the Data-WorkAttach-File class. This triggers when an instance is committed Save or Saved.

    Note: Trigger when an instance can be changed as required. Same is the case with the Execute option for the Trigger activity.
  2. Configure a Trigger activity as a custom activity and execute the condition as required.

    In the activity, perform a property-set on the .pyFileSize with calculation as below,
    0.75 * @String.length(.pyAttachStream)/1024 (for KB).

    Step 1 in the activity log the Purposes and is not required. The Calculation logic is for KB conversion. The same can be changed as required.
  3. Save the activity as a Trigger from the Security tab.


    For reference, an out-of-the-box declare trigger exists on the Data-WorkAttach-File class named pySaveContent.


Published April 6, 2019 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us