Consume a file using a File Listener and attach to Work Object as it is
I have a requirement to consume a file using a file listener and attach it to work object as is. I was able to achieve this using the below steps.
1) setting the process method to "file at a time" on service file rule
2) mapping the content of the file to temperory property on clipboard.
3) converting the content of that property to base 64 by running a function
4) assigning that property to "pyAttachStream" of "Data-WorkAttach-File" along with some other properties.
5) And linking that attachment to work object using the OOTB activity "pxLinkAttachmentToCase"
after all this it is successfully attaching the file to WO but when i download the file it is getting corrupted. I've tried changing the data mode in service file rule to "Binary" and doing the above mentioned steps using a parse structured rule but still no luck. I've tried with CSV and XLS formats and also feeding an empty excel file but still didn't work. Can anybody throw some light here.