Support Article

Illegal character detected error during Add Attachments




The user has upgraded from Pega 7.4 to Pega 8.1 and installed Pega 8.1.1 Patch Release. The user is using Pega-provided functionality to add attachments to the application. When an attachment is added, an extra colon (:) is added at the end of the file name and Pega throws an exception. Also, in the previous release (Pega 7.4), the user changed the default file Attachment Category by adding a Java step. Now, in Pega 8.1.1, this causes a severe guardrail warning.

Error Messages

Illegal character detected in the path "/StaticContent/global/ServiceExport/file_name.xlsx:". You may not use ",?,*,<,>,|,:


Steps to Reproduce

  1. Click Add Attachments.
  2. In the pop-up window, click Select files..
  3. Select one file and click Open.
    See the Exception in the Tracer.


Root Cause

A defect or configuration issue in the operating environment 

In Pega 8.1, the Attachment control and its corresponding activity (@baseclass.pyUploadFile) are updated to use the colon (:) as a separator instead of the semicolon (;) for holding multiple file names. File names in Microsoft Windows can contain a semicolon (;). 




To specify an attachment category, complete the following steps as an alternative to overriding the activity pyUploadFile:

  1. Override the attachment section, which contains the control pzMultiFilePath.
  2. Create an activity that sets pyCategory on the primary and then invokes the activity pyUploadFile.
  3. Pass the new activity name as a parameter to the control pzMultiFilePath.



Published December 11, 2018 - Updated January 28, 2019

50% found this useful

Have a question? Get answers now.

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