I I take the outxml value and create a xml file to attach to the item in a sharepoint list. The code is the following
string formXml = MainDataSource.CreateNavigator().OuterXml;
byte[] attachment = Sytem.Text.Encoding.UTF8.GetBytes(formXml);
item.Attachments.Add("InfoPathForm.xml", attachment);
The ode works but when I try to open the xml file I get a error screen from formserver. I try to open the file outside sharepoint and I get a error about security. What do I need to do to save the infopath form to xml file using code?
How I can get the real error because the one that I get is so generic?
I know this is infopath forum and not Sharepoint but you can think the I what to have the xsn file as xml and be able to open as infopath form
Thanks!