Support Article
Special characters encoded in file attachments' names
SA-9552
Summary
Special characters are encoded after attaching files to work objects. This is causing file names to grow significantly to the point that they exceed length restrictions. It also makes them hard to read.
For example, file name MyFile!#( ).pdf translates into MyFile#21#23#28#20#29.pdf after upload, where:
! - is encoded as: #21
# - is encoded as: #23
( - is encoded as: #28
) - is encoded as: #29
blank character - is encoded as: #20
Error Messages
Not Applicable
Steps to Reproduce
Upload a file that has special characters in the name, for example, MyFile!*( ).pdf.
Root Cause
This is caused due to encoding of the Clipboard property, pxRequestor.pyFileUpload, used in the application to display the attached file name. To upload desktop files a custom version of standard FilePath control is used. The control contains hidden input element:
<input type="hidden" id="hiddenFilePath" name="hiddenFilePath" value=""/>
The value of the input element is passed to the custom upload activity as parameter param.hiddenFilePath. It is observed during debugging that the parameter value retains special characters in the filename without encoding.
Resolution
Modify the upload activity to use param.hiddenFilePath instead of property pxRequestor.pyFileUpload to resolve the issue.
Published June 12, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.