Did you ever get this to work?
I was able to get it to work with the following code:
public void CTRL35_5_Clicked(object sender, ClickedEventArgs e)
{
// Write your code here.
XPathNavigator mainDS = MainDataSource.CreateNavigator();
string base64EncodedString = mainDS.SelectSingleNode(
"my:myFields/my:Attachment", NamespaceManager).Value;
if (!String.IsNullOrEmpty(base64EncodedString))
{
DecoderInfoPathA.
InfoPathAttachmentDecoder decoder =
new DecoderInfoPathA.InfoPathAttachmentDecoder(base64EncodedString);
System.IO.
File.WriteAllBytes(
@\\Your\Path\Here + decoder.Filename, decoder.DecodedAttachment);
}
}
The only problem is that it will only work when the InfoPath form is in full trust...
I was hoping you may know a way to code in C# to have it have full trust when using InfoPath in client version only.