<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Microsoft Land</title>
	<atom:link href="http://sriramkunapuli.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://sriramkunapuli.com</link>
	<description></description>
	<lastBuildDate>Fri, 26 Apr 2013 13:47:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>Comment on File Upload Custom Site Field Control – SharePoint 2010 &#8211; Part 2 by Ritzy</title>
		<link>http://sriramkunapuli.com/2011/05/18/file-upload-custom-site-field-control-sharepoint-2010-part-2/#comment-275</link>
		<dc:creator><![CDATA[Ritzy]]></dc:creator>
		<pubDate>Fri, 26 Apr 2013 13:47:58 +0000</pubDate>
		<guid isPermaLink="false">http://sriramkunapuli.wordpress.com/?p=90#comment-275</guid>
		<description><![CDATA[Hi Sriram

I managed to get a little further. I am now able to select the column from the list and specify the document library. After i select my document, i press Upload button i get an error. So i modified the Button_Click event as follows ;

            String siteURL = SPContext.Current.Web.Url;
            string error_string = &quot;&quot;;
            
            try
            {
                using (SPSite sourceSite = new SPSite(siteURL))
                {
                    error_string = &quot;SPSite &quot; + sourceSite.Url;
                    using (SPWeb sourceWeb = sourceSite.OpenWeb())
                    {
                        error_string = &quot;SPWeb &quot; + sourceWeb.Url;
                        sourceWeb.AllowUnsafeUpdates = true;
                        FileUploadCustomField _field = (FileUploadCustomField)this.Field;
                        error_string = &quot;_field.UploadDocumentLibrary &quot; + _field.UploadDocumentLibrary;
                        SPList objList = sourceWeb.Lists[_field.UploadDocumentLibrary];
                        error_string = &quot;SPList &quot; + objList.Title;
                        SPFolder destFolder = objList.RootFolder;

                        if (UploadFileControl.PostedFile == null) return;
                        string strFileName = UploadFileControl.PostedFile.FileName.Substring(UploadFileControl.PostedFile.FileName.LastIndexOf(&quot;\\&quot;) + 1);
                        error_string = strFileName;
                        Stream fStream = UploadFileControl.PostedFile.InputStream;

                        SPFile objFile = destFolder.Files.Add(strFileName, fStream, true);
                        objFile.Item.UpdateOverwriteVersion();

                        StatusLabel.Text = &quot;Upload File :: Success &lt;a&gt;View (&quot; + &quot;/&quot; + objFile.ParentFolder + &quot;/&quot; + strFileName + &quot;)&lt;/a&gt;&quot;;
                        hdnFileName.Value = &quot;/&quot; + objFile.ParentFolder + &quot;/&quot; + strFileName;
                        sourceWeb.Dispose();
                    }
                }
            }
            catch (Exception ex)
            {
                StatusLabel.Text = &quot;Upload File &quot; + error_string + &quot; :: Failed &quot; + ex.Message + &quot; &quot; + ex.StackTrace;
            }

error_string captures the value of objects as the code is exectued.

The error returned to sharepoint is as follows.

Upload File _field.UploadDocumentLibrary :: Failed List &#039;&#039; does not exist at site with URL &#039;http://mysharepointsite:40861/ims/QMS&#039;. at Microsoft.SharePoint.SPListCollection.GetListByName(String strListName, Boolean bThrowException) at SharePoint2010.Controls.FieldUploadCustomFieldControl.UploadButton_Click(Object sender, EventArgs e)

So it seems for some reason UploadDocumentLibrary is being returned as &quot; &quot;.

An ideas why? Where could i start looking inorder to debug the error?]]></description>
		<content:encoded><![CDATA[<p>Hi Sriram</p>
<p>I managed to get a little further. I am now able to select the column from the list and specify the document library. After i select my document, i press Upload button i get an error. So i modified the Button_Click event as follows ;</p>
<p>            String siteURL = SPContext.Current.Web.Url;<br />
            string error_string = &#8220;&#8221;;</p>
<p>            try<br />
            {<br />
                using (SPSite sourceSite = new SPSite(siteURL))<br />
                {<br />
                    error_string = &#8220;SPSite &#8221; + sourceSite.Url;<br />
                    using (SPWeb sourceWeb = sourceSite.OpenWeb())<br />
                    {<br />
                        error_string = &#8220;SPWeb &#8221; + sourceWeb.Url;<br />
                        sourceWeb.AllowUnsafeUpdates = true;<br />
                        FileUploadCustomField _field = (FileUploadCustomField)this.Field;<br />
                        error_string = &#8220;_field.UploadDocumentLibrary &#8221; + _field.UploadDocumentLibrary;<br />
                        SPList objList = sourceWeb.Lists[_field.UploadDocumentLibrary];<br />
                        error_string = &#8220;SPList &#8221; + objList.Title;<br />
                        SPFolder destFolder = objList.RootFolder;</p>
<p>                        if (UploadFileControl.PostedFile == null) return;<br />
                        string strFileName = UploadFileControl.PostedFile.FileName.Substring(UploadFileControl.PostedFile.FileName.LastIndexOf(&#8220;\\&#8221;) + 1);<br />
                        error_string = strFileName;<br />
                        Stream fStream = UploadFileControl.PostedFile.InputStream;</p>
<p>                        SPFile objFile = destFolder.Files.Add(strFileName, fStream, true);<br />
                        objFile.Item.UpdateOverwriteVersion();</p>
<p>                        StatusLabel.Text = &#8220;Upload File :: Success <a>View (&#8221; + &#8220;/&#8221; + objFile.ParentFolder + &#8220;/&#8221; + strFileName + &#8220;)</a>&#8220;;<br />
                        hdnFileName.Value = &#8220;/&#8221; + objFile.ParentFolder + &#8220;/&#8221; + strFileName;<br />
                        sourceWeb.Dispose();<br />
                    }<br />
                }<br />
            }<br />
            catch (Exception ex)<br />
            {<br />
                StatusLabel.Text = &#8220;Upload File &#8221; + error_string + &#8221; :: Failed &#8221; + ex.Message + &#8221; &#8221; + ex.StackTrace;<br />
            }</p>
<p>error_string captures the value of objects as the code is exectued.</p>
<p>The error returned to sharepoint is as follows.</p>
<p>Upload File _field.UploadDocumentLibrary :: Failed List &#8221; does not exist at site with URL &#8216;http://mysharepointsite:40861/ims/QMS&#8217;. at Microsoft.SharePoint.SPListCollection.GetListByName(String strListName, Boolean bThrowException) at SharePoint2010.Controls.FieldUploadCustomFieldControl.UploadButton_Click(Object sender, EventArgs e)</p>
<p>So it seems for some reason UploadDocumentLibrary is being returned as &#8221; &#8220;.</p>
<p>An ideas why? Where could i start looking inorder to debug the error?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on File Upload Custom Site Field Control – SharePoint 2010 &#8211; Part 2 by Sriram</title>
		<link>http://sriramkunapuli.com/2011/05/18/file-upload-custom-site-field-control-sharepoint-2010-part-2/#comment-274</link>
		<dc:creator><![CDATA[Sriram]]></dc:creator>
		<pubDate>Thu, 25 Apr 2013 19:53:15 +0000</pubDate>
		<guid isPermaLink="false">http://sriramkunapuli.wordpress.com/?p=90#comment-274</guid>
		<description><![CDATA[Hi Ritzy, 

Unfortunately i cannot upload the solution as-is.  That&#039;s the reason why i have inserted the code. It&#039;s almost the same.  Can you tell me the errors that you are having. I would be able to reply to that.

Regards
Sriram]]></description>
		<content:encoded><![CDATA[<p>Hi Ritzy, </p>
<p>Unfortunately i cannot upload the solution as-is.  That&#8217;s the reason why i have inserted the code. It&#8217;s almost the same.  Can you tell me the errors that you are having. I would be able to reply to that.</p>
<p>Regards<br />
Sriram</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on File Upload Custom Site Field Control – SharePoint 2010 &#8211; Part 2 by Ritzy</title>
		<link>http://sriramkunapuli.com/2011/05/18/file-upload-custom-site-field-control-sharepoint-2010-part-2/#comment-273</link>
		<dc:creator><![CDATA[Ritzy]]></dc:creator>
		<pubDate>Thu, 25 Apr 2013 09:41:57 +0000</pubDate>
		<guid isPermaLink="false">http://sriramkunapuli.wordpress.com/?p=90#comment-273</guid>
		<description><![CDATA[Hi Chris

I know this is a slightly old thread, but i would like to use this custom field in a project, but i am getting syntax errors? It seems you are the only one who managed to get it to work? Can you send me your working project please?? :-)]]></description>
		<content:encoded><![CDATA[<p>Hi Chris</p>
<p>I know this is a slightly old thread, but i would like to use this custom field in a project, but i am getting syntax errors? It seems you are the only one who managed to get it to work? Can you send me your working project please?? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on File Upload Custom Site Field Control – SharePoint 2010 &#8211; Part 2 by Ritzy</title>
		<link>http://sriramkunapuli.com/2011/05/18/file-upload-custom-site-field-control-sharepoint-2010-part-2/#comment-272</link>
		<dc:creator><![CDATA[Ritzy]]></dc:creator>
		<pubDate>Thu, 25 Apr 2013 09:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://sriramkunapuli.wordpress.com/?p=90#comment-272</guid>
		<description><![CDATA[I&#039;m getting syntax errors and would just like to compare my project with a working version.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m getting syntax errors and would just like to compare my project with a working version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on File Upload Custom Site Field Control – SharePoint 2010 &#8211; Part 2 by Ritzy</title>
		<link>http://sriramkunapuli.com/2011/05/18/file-upload-custom-site-field-control-sharepoint-2010-part-2/#comment-271</link>
		<dc:creator><![CDATA[Ritzy]]></dc:creator>
		<pubDate>Thu, 25 Apr 2013 09:35:45 +0000</pubDate>
		<guid isPermaLink="false">http://sriramkunapuli.wordpress.com/?p=90#comment-271</guid>
		<description><![CDATA[Hi Sriram.

I have to hand it to you, this is a very good solution! Is there any chance you could upload the actual project its self?

Would really appreciate it.

Thanks.]]></description>
		<content:encoded><![CDATA[<p>Hi Sriram.</p>
<p>I have to hand it to you, this is a very good solution! Is there any chance you could upload the actual project its self?</p>
<p>Would really appreciate it.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on File Upload Custom Site Field Control – SharePoint 2010 &#8211; Part 2 by Sriram</title>
		<link>http://sriramkunapuli.com/2011/05/18/file-upload-custom-site-field-control-sharepoint-2010-part-2/#comment-270</link>
		<dc:creator><![CDATA[Sriram]]></dc:creator>
		<pubDate>Sat, 20 Apr 2013 07:28:57 +0000</pubDate>
		<guid isPermaLink="false">http://sriramkunapuli.wordpress.com/?p=90#comment-270</guid>
		<description><![CDATA[FileUploadCustomField.cs doesn&#039;t instantiate FileUploadCustomField, it will create a BaseFieldControl of type FileUploadCustomFieldControl which is the one that needs to be rendered.]]></description>
		<content:encoded><![CDATA[<p>FileUploadCustomField.cs doesn&#8217;t instantiate FileUploadCustomField, it will create a BaseFieldControl of type FileUploadCustomFieldControl which is the one that needs to be rendered.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on File Upload Custom Site Field Control – SharePoint 2010 &#8211; Part 2 by Kodle</title>
		<link>http://sriramkunapuli.com/2011/05/18/file-upload-custom-site-field-control-sharepoint-2010-part-2/#comment-269</link>
		<dc:creator><![CDATA[Kodle]]></dc:creator>
		<pubDate>Wed, 17 Apr 2013 02:41:33 +0000</pubDate>
		<guid isPermaLink="false">http://sriramkunapuli.wordpress.com/?p=90#comment-269</guid>
		<description><![CDATA[Hi Sriram,

I think your code are missing some lines, for example, in the &quot;FileUploadCustomField.cs&quot;, on the &#039;FieldRenderingControl&#039;, your new FileUploadCustomField() doesn&#039;t input the arguments as required by the 2 constructors that you have included in this example.

Or point me out if I&#039;m wrong here.

Regards,
Kodle]]></description>
		<content:encoded><![CDATA[<p>Hi Sriram,</p>
<p>I think your code are missing some lines, for example, in the &#8220;FileUploadCustomField.cs&#8221;, on the &#8216;FieldRenderingControl&#8217;, your new FileUploadCustomField() doesn&#8217;t input the arguments as required by the 2 constructors that you have included in this example.</p>
<p>Or point me out if I&#8217;m wrong here.</p>
<p>Regards,<br />
Kodle</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on File Upload Custom Site Field Control – SharePoint 2010 &#8211; Part 2 by Kodle</title>
		<link>http://sriramkunapuli.com/2011/05/18/file-upload-custom-site-field-control-sharepoint-2010-part-2/#comment-268</link>
		<dc:creator><![CDATA[Kodle]]></dc:creator>
		<pubDate>Wed, 17 Apr 2013 02:37:56 +0000</pubDate>
		<guid isPermaLink="false">http://sriramkunapuli.wordpress.com/?p=90#comment-268</guid>
		<description><![CDATA[Hi bhargavi, 

You will need to reference the System.Web in your Visual Studio before importing into the code.

regards,
Kodle]]></description>
		<content:encoded><![CDATA[<p>Hi bhargavi, </p>
<p>You will need to reference the System.Web in your Visual Studio before importing into the code.</p>
<p>regards,<br />
Kodle</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on UpdatePanel &#8211; Ajax &#8211; PostBack &#8211; Removes Page Title by tester</title>
		<link>http://sriramkunapuli.com/2011/05/16/updatepanel-ajax-postback-removes-page-title/#comment-267</link>
		<dc:creator><![CDATA[tester]]></dc:creator>
		<pubDate>Thu, 21 Mar 2013 13:57:50 +0000</pubDate>
		<guid isPermaLink="false">http://sriramkunapuli.wordpress.com/?p=80#comment-267</guid>
		<description><![CDATA[fixed my issue with sharepoint 2010]]></description>
		<content:encoded><![CDATA[<p>fixed my issue with sharepoint 2010</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on UpdatePanel &#8211; Ajax &#8211; PostBack &#8211; Removes Page Title by xr280xr</title>
		<link>http://sriramkunapuli.com/2011/05/16/updatepanel-ajax-postback-removes-page-title/#comment-266</link>
		<dc:creator><![CDATA[xr280xr]]></dc:creator>
		<pubDate>Wed, 06 Mar 2013 19:42:06 +0000</pubDate>
		<guid isPermaLink="false">http://sriramkunapuli.wordpress.com/?p=80#comment-266</guid>
		<description><![CDATA[Had no affect for me.]]></description>
		<content:encoded><![CDATA[<p>Had no affect for me.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
