<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: c# to extract InfoPath Attachment.</title><link>https://www.infopathdev.com:443/forums/thread/96068.aspx</link><pubDate>Fri, 21 Feb 2014 16:45:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:96068</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/96068.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=96068</wfw:commentRss><description>&lt;p&gt;Any code that accesses a local filesystem (including shared drives) is going to require full trust, and there isn&amp;#39;t a way to make the code &amp;quot;partially&amp;quot; full trust. Is there any chance you could instead write the files to an intranet web/SharePoint server? That should be possible from a domain trust form.&lt;/p&gt;&lt;p&gt;When you say &amp;quot;when the infopath form is running on the client&amp;quot;, are you saying that the form will sometimes be running on the client and sometimes on the server, or am I just reading too much into that?&lt;/p&gt;</description></item><item><title>c# to extract InfoPath Attachment.</title><link>https://www.infopathdev.com:443/forums/thread/96017.aspx</link><pubDate>Wed, 19 Feb 2014 20:09:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:96017</guid><dc:creator>esteuardo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/96017.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=96017</wfw:commentRss><description>&lt;p&gt;Hello everyone,&lt;/p&gt;&lt;p&gt;I used the following code to extract an InfoPath attachment to a shared drive.&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; CTRL35_5_Clicked(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ClickedEventArgs&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; e)&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;
&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;        {&lt;/p&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Write your code here.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; mainDS = MainDataSource.CreateNavigator();&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;

&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; base64EncodedString = mainDS.SelectSingleNode(&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;
&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:myFields/my:Attachment&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;

&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (!&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.IsNullOrEmpty(base64EncodedString))&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;
&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;            {&lt;/p&gt;&lt;p&gt;                DecoderInfoPathA.&lt;/p&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;InfoPathAttachmentDecoder&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; decoder =&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;
&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; DecoderInfoPathA.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;InfoPathAttachmentDecoder&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(base64EncodedString);&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;

&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;                System.IO.&lt;/p&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;File&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.WriteAllBytes(&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;
&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;@&amp;quot;\\Shared\Drive\Path\Here\&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + decoder.Filename, decoder.DecodedAttachment);&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;
&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;            }&lt;/p&gt;&lt;p&gt;        }&lt;/p&gt;&lt;p&gt;The porblem is that this code only works when the InfoPath form is in full turst and of course the governance group is never going to let tha that happen.&amp;nbsp; I&amp;#39;m wondering if any one knows of an alternative approach or a way to write some code that will enable just that code to run in full trust mode when the infopath form is running on the client.&lt;/p&gt;&lt;p&gt;Thanks!&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>