Created
December 12, 2018 21:01
-
-
Save cjvandyk/25dcae339a3f99325fd67fa913203f79 to your computer and use it in GitHub Desktop.
Save decoded attachment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create an XmlNamespaceManager | |
XmlNamespaceManager ns = this.NamespaceManager; | |
//Create an XPathNavigator object for the Main data source | |
XPathNavigator xnMain = this.MainDataSource.CreateNavigator(); | |
//Create an XPathNavigator object for the attachment node | |
XPathNavigator xnAttNode = xnMain.SelectSingleNode("/my:myFields/my:theAttachmentField", ns); | |
//Obtain the text of the node. | |
string theAttachment = xnAttNode.Value; | |
if(theAttachment.Length > 0) | |
{ | |
InfoPathAttachmentDecoder myDecoder = new InfoPathAttachmentDecoder(theAttachment); | |
myDecoder.SaveAttachment(@"Path to the folder to save the attachment"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment