<?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: Separating attachments from InfoPath 2007 browser enabled forms</title><link>https://www.infopathdev.com:443/forums/thread/39955.aspx</link><pubDate>Wed, 25 Mar 2009 06:42:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39955</guid><dc:creator>ligeshkoshy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39955.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=39955</wfw:commentRss><description>&lt;p&gt;Thanks for your replies . I got some workarounds from it and built my solution.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;Workaround&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;Add a attachment control in the InfoPath form. I had a submit button which submits the document in a specified document library and returns a link from it which gets added up in a textbox in the InfoPath form . In the design mode the textbox is changed to hyperlink. When it form is deployed we can see the textbox is viewed as a hyperlink.&lt;/p&gt;
&lt;p&gt;Bits of code to detach the file, place it in document library , get a link value&amp;nbsp;to the hyperlink converted textbox.&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;char&lt;/font&gt;&lt;font size="2"&gt;[] charFileName = System.Text.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;UnicodeEncoding&lt;/font&gt;&lt;font size="2"&gt;.Unicode.GetChars(fnBytes);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; fileName = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt;(charFileName);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;fileName = fileName.Substring(0, fileName.Length - 1);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// The file is located after the header, which is 24 bytes long&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// plus the length of the filename. &lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;byte&lt;/font&gt;&lt;font size="2"&gt;[] fileContents = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;byte&lt;/font&gt;&lt;font size="2"&gt;[attachmentNodeBytes.Length - (24 + fnLength)];&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;for&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; i = 0; i &amp;lt; fileContents.Length; ++i)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;fileContents[i] = attachmentNodeBytes[24 + fnLength + i];&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; SiteAttachURL = _strDocLibURL + strReqID + &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;_&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; + fileName;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;Add it to document library&lt;/u&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font color="#008080" size="2"&gt;SPSite&lt;/font&gt;&lt;font size="2"&gt; siteCol = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;SPWeb&lt;/font&gt;&lt;font size="2"&gt; curSite = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;siteCol = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#008080" size="2"&gt;SPSite&lt;/font&gt;&lt;font size="2"&gt;(&amp;quot;url of root site);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;curSite = siteCol.OpenWeb();&lt;/p&gt;curSite.AllowUnsafeUpdates = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;curSite.Files.Add(SiteAttachURL, fileContents);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;font color="#008080" size="2"&gt;&lt;u&gt;Add link in the hyperlink converted textbox &lt;/u&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; nav1 = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:secContentView/my:secContent/my:secAttachments/my:templateURL&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;nav1.SetValue(SiteAttachURL);&lt;/p&gt;
&lt;p&gt;&lt;u&gt;Code to Detach document from the InfoPath attachment control&amp;nbsp;can be follwed from&amp;nbsp;the below link&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.sharepointblogs.com/ssa/archive/2008/01/15/infopath-delete-file-attachments-programmatically-c.aspx"&gt;http://www.sharepointblogs.com/ssa/archive/2008/01/15/infopath-delete-file-attachments-programmatically-c.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please check whether you have appropriate permissions to add a document to the document library and add AllowUnsafeUpdates = &lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Separating attachments from InfoPath 2007 browser enabled forms</title><link>https://www.infopathdev.com:443/forums/thread/39210.aspx</link><pubDate>Thu, 05 Mar 2009 07:24:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39210</guid><dc:creator>Anuma</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39210.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=39210</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you verify below link.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infopathdev.com/files/folders/examples/entry29401.aspx"&gt;http://www.infopathdev.com/files/folders/examples/entry29401.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.qdabra.com/en/products/qRules.aspx"&gt;http://www.qdabra.com/en/products/qRules.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Separating attachments from InfoPath 2007 browser enabled forms</title><link>https://www.infopathdev.com:443/forums/thread/39207.aspx</link><pubDate>Thu, 05 Mar 2009 06:14:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39207</guid><dc:creator>ligeshkoshy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39207.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=39207</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;We have a requirement in the project to separate the attachment embedded in the InfoPath 2007 browser enabled form to be saved in a MOSS 2007 document library with only the&amp;nbsp;link between them&amp;nbsp;saved in the InfoPath form to improve performance. &lt;/p&gt;
&lt;p&gt;We need to have the approach like&amp;nbsp;Opening a Excel template or a Web form(aspx page)&amp;nbsp;on button click. Can it be done through XMLFormView , and will it have improved performance than embedding the attachment in the InfoPath 2007 form itself.&lt;/p&gt;
&lt;p&gt;Any input is appreciated.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>