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.
Illegal character detected in the path "/StaticContent/global/ServiceExport/file_name.xlsx:". You may not use ",?,*,<,>,|,:
Steps to Reproduce
- Click Add Attachments.
- In the pop-up window, click Select files..
- Select one file and click Open.
See the Exception in the Tracer.
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:
- Override the attachment section, which contains the control pzMultiFilePath.
- Create an activity that sets pyCategory on the primary and then invokes the activity pyUploadFile.
- Pass the new activity name as a parameter to the control pzMultiFilePath.
Published December 11, 2018 - Updated January 28, 2019