How to: Uploading a File to a SharePoint Library Site from a Local Folder

I am currently developing an application that will help my team (Office Developer Documents) to manage all the metadata associated with the publishing process in MSDN. The name of the tool is Rawhide and it’s a Web-based application. I am really excited of developing this tool because I am working with Whidbey, ASP.NET 2.0, SQL Server, Windows Sharepoint Services, and a cool set Office development features. Soon I will start adding Office “12” enhancements such as Excel Services and Windows Sharepoint Services “v3”. I can’t wait!

I am learning a lot from my peers about how interesting it is to publish content in MSDN and I hope this tool will improve our working experience and become a great source of code snippets that I can share with the community.

Today I was reading the newsgroups and I was looking at lots of posts where developers are looking for code that will help to upload programmatically files to a SharePoint library. I was surprised to see that there are lots of developers struggling with this issue. I am too :). One of Rawhide’s features is to submit our articles, code samples, and art to a SharePoint Library.

I found two great articles that are helping me out to accomplish my mission. I know there are many ways of doing that, but this is the recommended one by Microsoft and I love it because it has just what I needed and it has code in C# and VB.NET:

Uploading a File to a SharePoint Site from a Local Folder

I also found this page that has all the information I need to work with the SPFileClass.

And finally, I found this interesting blog entry at Bill Simser’s blog where he talks about the Syncronization of Office Document Properties with WSS Document Libraries. I haven't tested this yet, but apparently, if you create the following properties in a Sharepoint library or list:

Hyperlink base

"The MS/Office documents that are upload inherit such corresponding custom MS/Office properties : "


As soon as I complete my "upload files to SharePoint" features in Rawhide, I will keep you posted with the outcome.