<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Attach zip file to infopath form</title><link>https://www.infopathdev.com:443/forums/thread/48377.aspx</link><pubDate>Thu, 29 Oct 2009 19:12:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:48377</guid><dc:creator>zlatan24</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/48377.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=48377</wfw:commentRss><description>&lt;p&gt;For work with zip files I prefer to use-&lt;a href="http://www.recoverytoolbox.com/windows_vista_xp_zip_file_repair.html" target="_blank" title="http://www.recoverytoolbox.com/windows_vista_xp_zip_file_repair.html"&gt;fix windows zip on vista&lt;/a&gt;-on next reason.Once I saw that all my zip files were deleted from PC.I used another programs but they couldn&amp;#39;t help to me.And this tool solved my problems quickly and for free.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Attach zip file to infopath form</title><link>https://www.infopathdev.com:443/forums/thread/33031.aspx</link><pubDate>Mon, 13 Oct 2008 07:38:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33031</guid><dc:creator>jaiminsarda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33031.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33031</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thanks Hilary. &lt;/p&gt;&lt;p&gt;&amp;nbsp;file attachment is working now.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Jaimin &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Attach zip file to infopath form</title><link>https://www.infopathdev.com:443/forums/thread/32925.aspx</link><pubDate>Wed, 08 Oct 2008 12:08:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32925</guid><dc:creator>jaiminsarda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32925.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32925</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;thanks for the help. I&amp;#39;ll try this and let you know if it works or not.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Jaimin &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Attach zip file to infopath form</title><link>https://www.infopathdev.com:443/forums/thread/32890.aspx</link><pubDate>Tue, 07 Oct 2008 14:36:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32890</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32890.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32890</wfw:commentRss><description>&lt;p&gt;Hi there:&lt;/p&gt;
&lt;p&gt;First off, please check out &lt;a href="http://support.microsoft.com/kb/892730"&gt;this&lt;/a&gt; KB article for information on encoding and decoding. It will help you with things like setting the file name. To select a node and set the value, you can use the following, changing the xpath to point to your node:&lt;/p&gt;
&lt;blockquote&gt;&lt;font size="2"&gt;&lt;/font&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; xpath = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:myFields/my:field1&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;&lt;font size="2"&gt;XPathNavigator node = MainDataSource.CreateNavigator().SelectSingleNode(xpath, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.NamespaceManager);&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;node.SetValue(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;value&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/blockquote&gt;</description></item><item><title>Attach zip file to infopath form</title><link>https://www.infopathdev.com:443/forums/thread/32882.aspx</link><pubDate>Tue, 07 Oct 2008 10:49:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32882</guid><dc:creator>jaiminsarda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32882.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32882</wfw:commentRss><description>&lt;p&gt;Hi All,&lt;/p&gt;&lt;p&gt;I am using infopath 2007.&amp;nbsp;&lt;/p&gt;&lt;p&gt;In my sharepoint form library, I have an infopath form which has an attachment field.&lt;/p&gt;&lt;p&gt;This is my requirement --&amp;gt; On button click, I need to programmatically attach a &lt;b&gt;zip file&lt;/b&gt; to that attachment field.&lt;/p&gt;&lt;p&gt;I know attachments in infopath are stored in base64 encoded string. &lt;/p&gt;&lt;p&gt;Till now I am successfully able to load the zip file into byte[] array and convert it into base64 string. This is the code snippet:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;string strFilePath = &amp;quot;C:\\Test.zip&amp;quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FileStream fs = new FileStream(strFilePath, FileMode.Open, FileAccess.Read);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BinaryReader br = new BinaryReader(fs);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] data = new byte[fs.Length];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fs.Read(data, 0, data.Length);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fs.Close();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string strBase64 = Convert.ToBase64String(data);&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;After this how do I set the value of infopath attachment field as strBase64??&lt;/p&gt;&lt;p&gt;&amp;nbsp;Is this is the right approach or am I going wrong??&lt;/p&gt;&lt;p&gt;Need help. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks,&lt;/p&gt;&lt;p&gt;Jaimin &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>