Whenever we attach any file in Pega, we need to perform a virus scan (to extend the call virus check functionality) using the existing API on the business side.
API will scan the file and based on the response we need to attach the file.
We have challenges sending a file as “multipart/form-data” in connection-REST.
Our external system does not accept Base64 format. So we should not send base64 format.
So what kind format accepted by the external system. I think you can use java to convert base64 format to accepted format and set value to RequestAttachmentPage. Try it out
Pega has an undocumented feature on how to send multipart/form-data across a REST connection. It’s fairly simple, but you just need to know what values to set.
Below is a screenshot of a configuration of a multipart/form-data message that contains json instead of base64 data.
Empty values are possible and leave that particular field out of the message. i.e. an empty pyAttachFieldNames value won’t send a filename.
Note that these properties are value lists and the example above is just for one multipart message. In case you need to send 2 parts, add another items to each list.
@MarijeSchillern I think that would be a good place to put it. I see half my explanation is already there, just the part how to send a multipart without an attachment is missing if you’d ask me.