Support Article
Multipart PDF sent as a binary instead of base64 format
SA-83011
Summary
The Pega application does not send a multipart or form-data REST request with a document in the base64 encoded format (as set in the pyAttachValues property) along with a JSON request. Instead, the PDF is sent in the binary format.
Error Messages
Not Applicable
Steps to Reproduce
- Populate the pyRequestAttachmentPage with the below properties:
pyAttachValues – This contains the base64 encoded string of the PDF
pyAttachNames – This is set to the form-data element name
pyAttachFileNames – This is the file name
pyAttachTypes – This is set as multipart or form-data
- Create a REST-Connector with a POST request configured to send a JSON request.
Root Cause
The pyAttachTypes was set as 'multiform/form-data' in the pyRequestAttachmentPage.
Resolution
Perform the following local-change:
- Set the pyAttachTypes as 'text/plain'.
- Removing the pyAttachFileNames setting.
Published August 15, 2019 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.