In Nintex for SP2013/2016 in on-prem there is the action "Copy to SharePoint" which basically does the thing - it allows to copy attachments from particular XML nodes from Infopath form into a chosen SharePoint library.
In O365 there is no such thing.
I did some deeper analysis on the issue and realized, that:
- Infopath is storing attachments inside the XML file, converted to Base64 string;
- Infopath file cannot exceed 5MB in O365 otherwise it will not be saved…;
- The Base64 string does not only contain file contents, but according to the article: https://support.microsoft.com/en-us/kb/2517906 it does as well contain filename and some additional header information;
- I can create a file using REST and SOAP web services, however I cannot cut off the header information from the Base64 string (as I don’t know where it ends), I cannot as well convert (decode) Base64 string to a binary (no such function, no available web service, etc…) without a custom code.
- It all leads me to a simple conclusion – in O365 I am not able to get Infopath attachments and store them in a given library folder. I have tried all options I could use. Nintex does not have it OOTB as it has in on-prem unfortunately - it should be done for example using the Remote Event Receiver (RER) that would be fired when a new Infopath form is submitted and that it does all the logic.
Has anyone got a similar problem? If so - how have you solved it?